Class: Rails::Application::Railties

Inherits:
Object
  • Object
show all
Defined in:
lib/rails/application/railties.rb

Instance Method Summary collapse

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

#enginesObject



19
20
21
# File 'lib/rails/application/railties.rb', line 19

def engines
  @engines ||= ::Rails::Engine.subclasses.map(&:new)
end

#pluginsObject



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

#railtiesObject



15
16
17
# File 'lib/rails/application/railties.rb', line 15

def railties
  @railties ||= ::Rails::Railtie.subclasses.map(&:new)
end