Module: Sunzi::Plugin
- Defined in:
- lib/sunzi/plugin.rb
Class Method Summary collapse
-
.load ⇒ Object
Find gems that start with “sunzi-*” and require them automatically.
Class Method Details
.load ⇒ Object
Find gems that start with “sunzi-*” and require them automatically. If that gem is a plugin, it will call the register method on load.
7 8 9 10 11 12 13 14 |
# File 'lib/sunzi/plugin.rb', line 7 def load plugins = Gem::Specification.find_all.select{|plugin| plugin.name =~ /sunzi-.+/ } plugins.each do |plugin| require plugin.name.gsub('-','/') Sunzi.thor.source_paths << Pathname.new(plugin.gem_dir) end end |