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)
41 42 43 44 45 |
# File 'lib/pluginator/autodetect.rb', line 41 def initialize(group, ={}) super(group) @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”)`
52 53 54 55 56 57 |
# File 'lib/pluginator/autodetect.rb', line 52 def refresh plugin_lists = FormattedFinder.new(@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
60 61 62 |
# File 'lib/pluginator/autodetect.rb', line 60 def type @plugins[@force_type] unless @force_type.nil? end |