Class: Rails::Engine::Railties

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

Direct Known Subclasses

Application::Railties

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Railties

TODO Write tests for this behavior extracted from Application



5
6
7
# File 'railties/lib/rails/engine/railties.rb', line 5

def initialize(config)
  @config = config
end

Class Method Details

.enginesObject



26
27
28
# File 'railties/lib/rails/engine/railties.rb', line 26

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

.railtiesObject



22
23
24
# File 'railties/lib/rails/engine/railties.rb', line 22

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

Instance Method Details

#all(&block) ⇒ Object



9
10
11
12
13
# File 'railties/lib/rails/engine/railties.rb', line 9

def all(&block)
  @all ||= plugins
  @all.each(&block) if block
  @all
end

#pluginsObject



15
16
17
18
19
20
# File 'railties/lib/rails/engine/railties.rb', line 15

def plugins
  @plugins ||= begin
    plugin_names = (@config.plugins || [:all]).map { |p| p.to_sym }
    Plugin.all(plugin_names, @config.paths["vendor/plugins"].existent)
  end
end