Class: Pluginator::Autodetect
- Includes:
- NameConverter
- Defined in:
- lib/pluginator/autodetect.rb,
lib/pluginator/autodetect.rb,
lib/pluginator/autodetect/finder.rb,
lib/pluginator/autodetect/formatted_finder.rb
Overview
Add autodetection capabilities to Group
Direct Known Subclasses
Defined Under Namespace
Classes: Finder, FormattedFinder
Instance Attribute Summary
Attributes inherited from Group
Instance Method Summary collapse
-
#initialize(group, options = {}) ⇒ Autodetect
constructor
Automatically load plugins for given group (and type).
-
#refresh ⇒ Object
Initiate another lookup for plugins - does not clean the state - does not resolve all gems, only the new ones.
-
#type ⇒ Object
Return the forced type.
Methods inherited from Group
Constructor Details
#initialize(group, options = {}) ⇒ Autodetect
Automatically load plugins for given group (and type)
45 46 47 48 49 50 |
# File 'lib/pluginator/autodetect.rb', line 45 def initialize(group, ={}) super(group) @force_prefix = [:prefix] @force_type = [:type] refresh end |
Instance Method Details
#refresh ⇒ Object
Initiate another lookup for plugins
-
does not clean the state
-
does not resolve all gems, only the new ones
Use it after gem list change, for example after ‘Gem.install(“new_gem”)`
57 58 59 60 61 62 |
# File 'lib/pluginator/autodetect.rb', line 57 def refresh plugin_lists = FormattedFinder.new(@force_prefix, @group, @force_type) register_plugins(plugin_lists.loaded_plugins_path) load_plugins(plugin_lists.load_path_plugins_paths) activate_plugins(plugin_lists.gem_plugins_paths) end |
#type ⇒ Object
Return the forced type
65 66 67 |
# File 'lib/pluginator/autodetect.rb', line 65 def type @plugins[@force_type] unless @force_type.nil? end |