aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/engine/railties.rb
blob: e91bdbf1e5cfb1f5f4dbf688842f47c0f99a2bfa (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                                         
                                                                            




           
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)
        @all ||= plugins
        @all.each(&block) if block
        @all
      end

      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
    end
  end
end