Module: Kernel

### Home Classes Methods

### In Files

- lib/little-plugger.rb

### Methods

- #LittlePlugger

### Included Modules

- LittlePlugger::ClassMethods

### Files

- History.txt
- README.rdoc

### Class/Module Index

Quicksearch

- LittlePlugger
- LittlePlugger::ClassMethods
- Kernel

No matching classes.

# 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 <String>

      The default plugin path. Defaults to "module_name/plugins".

- :module <Module>

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

- :plugins <Array>

      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
    def LittlePlugger( opts = {} )
      return ::LittlePlugger::ClassMethods if opts.empty?
      Module.new {
        include ::LittlePlugger::ClassMethods

        if opts.key?(:path)
          eval %{def plugin_path() #{opts[:path].to_s.inspect} end}
        end

        if opts.key?(:module)
          eval %{def plugin_module() #{opts[:module].name} end}
        end

        if opts.key?(:plugins)
          plugins = Array(opts[:plugins]).map {|val| val.to_sym.inspect}.join(',')
          eval %{def plugin_names() @plugin_names ||= [#{plugins}] end}
        end
      }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.