Class: Slideshow::List

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ManifestHelper

#installed_plugin_manifest_patterns, #installed_plugin_manifests, #installed_quick_manifest_patterns, #installed_quick_manifests, #installed_template_manifest_patterns, #installed_template_manifests

Constructor Details

#initialize(config) ⇒ List

Returns a new instance of List.



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

def initialize( config )
  @config  = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/slideshow/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 plugins in search path'

  installed_plugin_manifest_patterns.each_with_index do |pattern,i|
    puts "    [#{i+1}] #{pattern.gsub(home,'~')}"
  end
  puts '  include:'

  installed_plugin_manifests.each do |manifest|
    pakname      = manifest[0].gsub('.txt','').gsub('.plugin','')
    manifestpath = manifest[1].gsub(home,'~')
    puts "%16s (%s)" % [pakname,manifestpath]
  end

  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