2010-06-23 10:10:26 -04:00
|
|
|
module Rails
|
|
|
|
class Engine < Railtie
|
|
|
|
class Railties
|
|
|
|
# TODO Write tests for this behavior extracted from Application
|
|
|
|
def initialize(config)
|
|
|
|
@config = config
|
|
|
|
end
|
|
|
|
|
|
|
|
def all(&block)
|
2012-01-02 15:49:18 -05:00
|
|
|
@all ||= []
|
2010-06-23 10:10:26 -04:00
|
|
|
@all.each(&block) if block
|
|
|
|
@all
|
|
|
|
end
|
|
|
|
|
2010-12-08 17:15:13 -05:00
|
|
|
def self.railties
|
|
|
|
@railties ||= ::Rails::Railtie.subclasses.map(&:instance)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.engines
|
|
|
|
@engines ||= ::Rails::Engine.subclasses.map(&:instance)
|
|
|
|
end
|
|
|
|
|
|
|
|
delegate :railties, :engines, :to => "self.class"
|
2010-06-23 10:10:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|