Class: Rails::Application::Railties
- Inherits:
-
Object
- Object
- Rails::Application::Railties
- Defined in:
- lib/rails/application/railties.rb
Instance Method Summary collapse
- #all(&block) ⇒ Object
- #engines ⇒ Object
-
#initialize(config) ⇒ Railties
constructor
TODO Write tests for this behavior extracted from Application.
- #plugins ⇒ Object
- #railties ⇒ Object
Constructor Details
#initialize(config) ⇒ Railties
TODO Write tests for this behavior extracted from Application
5 6 7 |
# File 'lib/rails/application/railties.rb', line 5 def initialize(config) @config = config end |
Instance Method Details
#all(&block) ⇒ Object
9 10 11 12 13 |
# File 'lib/rails/application/railties.rb', line 9 def all(&block) @all ||= railties + engines + plugins @all.each(&block) if block @all end |
#engines ⇒ Object
19 20 21 |
# File 'lib/rails/application/railties.rb', line 19 def engines @engines ||= ::Rails::Engine.subclasses.map(&:new) end |
#plugins ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rails/application/railties.rb', line 23 def plugins @plugins ||= begin plugin_names = (@config.plugins || [:all]).map { |p| p.to_sym } Plugin.all(plugin_names, @config.paths.vendor.plugins) end end |
#railties ⇒ Object
15 16 17 |
# File 'lib/rails/application/railties.rb', line 15 def railties @railties ||= ::Rails::Railtie.subclasses.map(&:new) end |