Methods

Included Modules

Class Index [+]

Quicksearch

Kernel

Public Instance Methods

LittlePlugger( opts = {} ) click to toggle source

This method allows the user to override some of LittlePlugger’s default settings when mixed into a module or class.

See the “Customizing” section of the LittlePlugger documentation for an example of how this method is used.

Options

  • :path

     The default plugin path. Defaults to "module_name/plugins".
    
  • :module

     The module where plugins will be loaded. Defaults to
     ModuleName::Plugins.
    
  • :plugins

     The array of default plugins to load. Only the plugins listed in this
     array will be loaded by LittlePlugger.
     # File lib/little-plugger.rb, line 302
302:   def LittlePlugger( opts = {} )
303:     return ::LittlePlugger::ClassMethods if opts.empty?
304:     Module.new {
305:       include ::LittlePlugger::ClassMethods
306: 
307:       if opts.key?(:path)
308:         eval %{def plugin_path() #{opts[:path].to_s.inspect} end}
309:       end
310: 
311:       if opts.key?(:module)
312:         eval %{def plugin_module() #{opts[:module].name} end}
313:       end
314: 
315:       if opts.key?(:plugins)
316:         plugins = Array(opts[:plugins]).map {|val| val.to_sym.inspect}.join(',')
317:         eval %{def plugin_names() @plugin_names ||= [#{plugins}] end}
318:       end
319:     }
320:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.