Module | Merb::Plugins |
In: |
merb-core/lib/merb-core/plugins.rb
|
*generators: | Generator paths to add to the list of plugin generators. |
This is the recommended way to register your plugin‘s generators in Merb.
:api: plugin
# File merb-core/lib/merb-core/plugins.rb, line 76 76: def self.add_generators(*generators) 77: Merb.add_generators(*generators) 78: end
*rakefiles: | Rakefiles to add to the list of plugin Rakefiles. |
This is a recommended way to register your plugin‘s Raketasks in Merb.
From merb_sequel plugin:
if defined(Merb::Plugins)
Merb::Plugins.add_rakefiles "merb_sequel" / "merbtasks"
end
:api: plugin
# File merb-core/lib/merb-core/plugins.rb, line 63 63: def self.add_rakefiles(*rakefiles) 64: Merb.add_rakefiles(*rakefiles) 65: end
Returns the configuration settings hash for plugins. This is prepopulated from Merb.root / "config/plugins.yml" if it is present.
Hash: | The configuration loaded from Merb.root / "config/plugins.yml" or, if the load fails, an empty hash whose default value is another Hash. |
:api: plugin
# File merb-core/lib/merb-core/plugins.rb, line 14 14: def self.config 15: @config ||= begin 16: # this is so you can do Merb.plugins.config[:helpers][:awesome] = "bar" 17: config_hash = Hash.new {|h,k| h[k] = {}} 18: file = Merb.root / "config" / "plugins.yml" 19: 20: if File.exists?(file) 21: require 'yaml' 22: to_merge = YAML.load_file(file) 23: else 24: to_merge = {} 25: end 26: 27: config_hash.merge(to_merge) 28: end 29: end