Class: Rails::Plugin::FileSystemLocator

Inherits:
Locator show all
Defined in:
lib/rails/plugin/locator.rb

Overview

The Rails::Plugin::FileSystemLocator will try to locate plugins by examining the directories the the paths given in configuration.plugin_paths. Any plugins that can be found are returned in a list.

The criteria for a valid plugin in this case is found in Rails::Plugin#valid?, although other subclasses of Rails::Plugin::Locator can of course use different conditions.

Instance Attribute Summary

Attributes inherited from Locator

#initializer

Instance Method Summary collapse

Methods inherited from Locator

#each, #initialize, #plugin_names

Constructor Details

This class inherits a constructor from Rails::Plugin::Locator

Instance Method Details

#pluginsObject

Returns all the plugins which can be loaded in the filesystem, under the paths given by configuration.plugin_paths.



42
43
44
45
46
47
# File 'lib/rails/plugin/locator.rb', line 42

def plugins
  initializer.configuration.plugin_paths.flatten.inject([]) do |plugins, path|
    plugins.concat locate_plugins_under(path)
    plugins
  end.flatten
end