Class: Rails::Plugin::Locator
- Includes:
- Enumerable
- Defined in:
- lib/rails/plugin/locator.rb
Overview
The Plugin::Locator class should be subclasses to provide custom plugin-finding abilities to Rails (i.e. loading plugins from Gems, etc). Each subclass should implement the located_plugins
method, which return an array of Plugin objects that have been found.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#initializer ⇒ Object
readonly
Returns the value of attribute initializer.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(initializer) ⇒ Locator
constructor
A new instance of Locator.
- #plugin_names ⇒ Object
-
#plugins ⇒ Object
This method should return all the plugins which this Plugin::Locator can find These will then be used by the current Plugin::Loader, which is responsible for actually loading the plugins themselves.
Constructor Details
#initialize(initializer) ⇒ Locator
Returns a new instance of Locator.
12 13 14 |
# File 'lib/rails/plugin/locator.rb', line 12 def initialize(initializer) @initializer = initializer end |
Instance Attribute Details
#initializer ⇒ Object (readonly)
Returns the value of attribute initializer.
10 11 12 |
# File 'lib/rails/plugin/locator.rb', line 10 def initializer @initializer end |
Instance Method Details
#each(&block) ⇒ Object
23 24 25 |
# File 'lib/rails/plugin/locator.rb', line 23 def each(&block) plugins.each(&block) end |
#plugin_names ⇒ Object
27 28 29 |
# File 'lib/rails/plugin/locator.rb', line 27 def plugin_names plugins.map(&:name) end |
#plugins ⇒ Object
This method should return all the plugins which this Plugin::Locator can find These will then be used by the current Plugin::Loader, which is responsible for actually loading the plugins themselves
19 20 21 |
# File 'lib/rails/plugin/locator.rb', line 19 def plugins raise "The `plugins' method must be defined by concrete subclasses of #{self.class}" end |