Class: Slideshow::Plugins

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PluginHelper

#find_plugin_patterns, #find_plugins, #load_plugins

Constructor Details

#initialize(opts, config) ⇒ Plugins

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



11
12
13
14
# File 'lib/slideshow/cli/commands/plugins.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/plugins.rb', line 16

def config
  @config
end

#optsObject (readonly)

Returns the value of attribute opts.



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

def run
  puts ''
  puts 'Plugin scripts on the load path'
  
  find_plugin_patterns.each_with_index do |pattern,i|
    puts "    [#{i+1}] #{pattern}"
  end
  puts '  include:'
  
  plugins = find_plugins
  if plugins.empty?
    puts "    -- none --"
  else
    plugins.each do |plugin|
      puts "    #{plugin}"
    end
  end
end