Class: Slideshow::List
- Inherits:
-
Object
- Object
- Slideshow::List
- Includes:
- ManifestHelper
- Defined in:
- lib/slideshow/cli/commands/list.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(logger, opts, config) ⇒ List
constructor
fix: remove opts, use config (wrapped!!).
- #run ⇒ Object
Methods included from ManifestHelper
#installed_quick_manifest_patterns, #installed_quick_manifests, #installed_template_manifest_patterns, #installed_template_manifests
Constructor Details
#initialize(logger, opts, config) ⇒ List
fix: remove opts, use config (wrapped!!)
9 10 11 12 13 |
# File 'lib/slideshow/cli/commands/list.rb', line 9 def initialize( logger, opts, config ) @logger = logger @opts = opts @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/slideshow/cli/commands/list.rb', line 15 def config @config end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
15 16 17 |
# File 'lib/slideshow/cli/commands/list.rb', line 15 def logger @logger end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
15 16 17 |
# File 'lib/slideshow/cli/commands/list.rb', line 15 def opts @opts end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/slideshow/cli/commands/list.rb', line 17 def run home = Env.home ## replace home w/ ~ (to make out more readable (shorter)) ## e.g. use gsub( home, '~' ) puts '' puts 'Installed quickstarter packs in search path' installed_quick_manifest_patterns.each_with_index do |pattern,i| puts " [#{i+1}] #{pattern.gsub(home,'~')}" end puts ' include:' installed_quick_manifests.each do |manifest| pakname = manifest[0].gsub('.txt','').gsub('.quick','') manifestpath = manifest[1].gsub(home,'~') puts "%16s (%s)" % [pakname,manifestpath] end puts '' puts 'Installed template packs in search path' installed_template_manifest_patterns.each_with_index do |pattern,i| puts " [#{i+1}] #{pattern.gsub(home,'~')}" end puts ' include:' installed_template_manifests.each do |manifest| pakname = manifest[0].gsub('.txt','') manifestpath = manifest[1].gsub(home,'~') puts "%16s (%s)" % [pakname,manifestpath] end end |