aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/engine/configurable.rb
blob: 9a370f0abbadff7a408fead54da734da1e3db6c9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                


                         

                                                           
                  
                                                                           












                                                               
module Rails
  class Engine
    module Configurable
      def self.included(base)
        base.extend ClassMethods
      end

      module ClassMethods
        delegate :middleware, :root, :paths, :to => :config

        def config
          @config ||= Engine::Configuration.new(find_root_with_flag("lib"))
        end

        def inherited(base)
          raise "You cannot inherit from a Rails::Engine child"
        end
      end

      def config
        self.class.config
      end
    end
  end
end