Skip to content

Instantly share code, notes, and snippets.

@makevoid
Created April 7, 2015 23:44
Show Gist options
  • Select an option

  • Save makevoid/9ffb3a4aefb5d81c5e1f to your computer and use it in GitHub Desktop.

Select an option

Save makevoid/9ffb3a4aefb5d81c5e1f to your computer and use it in GitHub Desktop.
Get all the apps you are developing on sorted by time
# Readme.md
#
# # apps_get
#
# ### Get all the apps you are developing on atm, sorted by time
#
# ### Set your configs (APP_PATH) and then:
#
# ruby appsGet.rb
#
# and you will get a list of your apps
#
# config.rb
#
APPS_PATH = "~/apps"
# utils.rb
#
appsGet = -> do
Dir.glob(File.expand_path "#{APPS_PATH}/*")
.sort_by { |app| File.mtime app }
.map do |app|
File.basename app
end
end
# main.rb
#
# require_relative 'utils'
APPS = appsGet.()
puts APPS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment