Class: Slideshow::Plugins
- Inherits:
-
Object
- Object
- Slideshow::Plugins
- Includes:
- PluginHelper
- Defined in:
- lib/slideshow/cli/commands/plugins.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) ⇒ Plugins
constructor
fix: remove opts, use config (wrapped!!).
- #run ⇒ Object
Methods included from PluginHelper
#find_plugin_patterns, #find_plugins, #load_plugins
Constructor Details
#initialize(logger, opts, config) ⇒ Plugins
fix: remove opts, use config (wrapped!!)
9 10 11 12 13 |
# File 'lib/slideshow/cli/commands/plugins.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/plugins.rb', line 15 def config @config end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
15 16 17 |
# File 'lib/slideshow/cli/commands/plugins.rb', line 15 def logger @logger end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
15 16 17 |
# File 'lib/slideshow/cli/commands/plugins.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 |
# File 'lib/slideshow/cli/commands/plugins.rb', line 17 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 |