Class: Fanforce::CLI::Apps
- Inherits:
-
Object
- Object
- Fanforce::CLI::Apps
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/fanforce/cli/apps.rb
Instance Method Summary collapse
Instance Method Details
#count ⇒ Object
32 33 34 |
# File 'lib/fanforce/cli/apps.rb', line 32 def count dir_names.size end |
#dir_names ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/fanforce/cli/apps.rb', line 6 def dir_names @dirs ||= Dir.chdir($HomeDir) do Dir['*/'].inject([]) do |dirs, d| d = d.gsub('/', '') next dirs if d !~ /^(app-[a-z0-9-]+)\/?$/ next dirs << d if $Filter.blank? next dirs << d if $Filter[:dir_name].present? and $Filter[:dir_name] == d next dirs end end end |
#dirs ⇒ Object
16 17 18 19 20 |
# File 'lib/fanforce/cli/apps.rb', line 16 def dirs dir_names.inject([]) do |result, d| result << "#{$HomeDir}/#{d}" end end |