Application object should instantiate non-vendored plugins

Signed-off-by: Carl Lerche <carllerche@mac.com>
This commit is contained in:
Sam Pohlenz 2009-12-27 11:16:34 +10:30 committed by Carl Lerche
parent 2e87196d14
commit cbce027669
2 changed files with 10 additions and 5 deletions

View File

@ -98,7 +98,7 @@ module Rails
def plugins
@plugins ||= begin
plugin_names = config.plugins || [:all]
Plugin.plugins.select { |p| plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) } +
Plugin.plugins.select { |p| plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) }.map { |p| p.new } +
Plugin::Vendored.all(config.plugins || [:all], config.paths.vendor.plugins)
end
end

View File

@ -27,12 +27,17 @@ module Rails
def self.rake_tasks(&blk)
@rake_tasks ||= []
@rake_tasks << blk
@rake_tasks << blk if blk
@rake_tasks
end
def self.load_tasks
return unless @rake_tasks
@rake_tasks.each { |blk| blk.call }
def rake_tasks
self.class.rake_tasks
end
def load_tasks
return unless rake_tasks
rake_tasks.each { |blk| blk.call }
end
# Creates an initializer which includes all given modules to the given class.