Sha256: 9e238f26fd3fcbcfc302ef37d21961baec6e2e85686243ed9f980cc0056db975

Contents?: true

Size: 914 Bytes

Versions: 11

Compression:

Stored size: 914 Bytes

Contents

# encoding: utf-8

module Slideshow

class Plugins

  include LogUtils::Logging

  include PluginHelper

  
  def initialize( config )
    @config  = config
  end

  attr_reader :config

  def run
    home = Env.home
    ## replace home w/ ~ (to make out more readable (shorter))
    ## e.g. use gsub( home, '~' )

    puts ''
    puts 'Plugin scripts on the load path'
    
    find_plugin_patterns.each_with_index do |pattern,i|
      puts "    [#{i+1}] #{pattern.gsub(home,'~')}"
    end
    puts '  include:'

    plugins = find_plugins
    if plugins.empty?
      puts "    -- none --"
    else
      plugins.each do |plugin|
        ## NB: use full_path - since Ruby 1.9.2 - ./ no longer included in load path for security
        plugin_fullpath = File.expand_path( plugin )
        puts "    #{plugin.gsub(home,'~')} (#{plugin_fullpath})"
      end
    end
  end

end # class Plugins
end # module Slideshow

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
slideshow-models-4.1.0 lib/slideshow/commands/plugins.rb
slideshow-models-4.0.1 lib/slideshow/commands/plugins.rb
slideshow-models-4.0.0 lib/slideshow/commands/plugins.rb
slideshow-models-3.3.1 lib/slideshow/commands/plugins.rb
slideshow-models-3.3.0 lib/slideshow/commands/plugins.rb
slideshow-models-3.2.0 lib/slideshow/commands/plugins.rb
slideshow-models-3.1.1 lib/slideshow/commands/plugins.rb
slideshow-models-3.1.0 lib/slideshow/commands/plugins.rb
slideshow-models-3.0.2 lib/slideshow/commands/plugins.rb
slideshow-models-3.0.1 lib/slideshow/commands/plugins.rb
slideshow-models-3.0.0 lib/slideshow/commands/plugins.rb