Skip to content
This repository
Newer
Older
100644 34 lines (28 sloc) 0.79 kb
c787bfdf »
2010-06-23 Engine can now load its own plugins
1 module Rails
2 class Engine < Railtie
3 class Railties
4 # TODO Write tests for this behavior extracted from Application
5 def initialize(config)
6 @config = config
7 end
8
9 def all(&block)
10 @all ||= plugins
11 @all.each(&block) if block
12 @all
13 end
14
15 def plugins
16 @plugins ||= begin
17 plugin_names = (@config.plugins || [:all]).map { |p| p.to_sym }
d649bf15 »
2010-10-06 Provide a cleaner syntax for paths configuration that does not rely o…
18 Plugin.all(plugin_names, @config.paths["vendor/plugins"].existent)
c787bfdf »
2010-06-23 Engine can now load its own plugins
19 end
20 end
051127d4 »
2010-12-08 Rails::Engine.find(path) - method to find engine by path
21
22 def self.railties
23 @railties ||= ::Rails::Railtie.subclasses.map(&:instance)
24 end
25
26 def self.engines
27 @engines ||= ::Rails::Engine.subclasses.map(&:instance)
28 end
29
30 delegate :railties, :engines, :to => "self.class"
c787bfdf »
2010-06-23 Engine can now load its own plugins
31 end
32 end
33 end
Something went wrong with that request. Please try again.