Class: Slideshow::List

Inherits:
Object
  • Object
show all
Includes:
LogUtils::Logging, ManifestHelper
Defined in:
lib/slideshow/cli/commands/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ManifestHelper

#installed_quick_manifest_patterns, #installed_quick_manifests, #installed_template_manifest_patterns, #installed_template_manifests

Constructor Details

#initialize(opts, config) ⇒ List

fix: remove opts, use config (wrapped!!)



11
12
13
14
# File 'lib/slideshow/cli/commands/list.rb', line 11

def initialize( opts, config )
  @opts    = opts
  @config  = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



16
17
18
# File 'lib/slideshow/cli/commands/list.rb', line 16

def config
  @config
end

#optsObject (readonly)

Returns the value of attribute opts.



16
17
18
# File 'lib/slideshow/cli/commands/list.rb', line 16

def opts
  @opts
end

Instance Method Details

#runObject



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
52
# File 'lib/slideshow/cli/commands/list.rb', line 18

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