diff options
Diffstat (limited to 'railties/lib/rails/application')
| -rw-r--r-- | railties/lib/rails/application/bootstrap.rb | 2 | ||||
| -rw-r--r-- | railties/lib/rails/application/configuration.rb | 18 | ||||
| -rw-r--r-- | railties/lib/rails/application/finisher.rb | 2 | ||||
| -rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 24 | 
4 files changed, 17 insertions, 29 deletions
| diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index e39b3bc705..213aa0768a 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -23,7 +23,7 @@ module Rails        # Initialize the logger early in the stack in case we need to log some deprecation.        initializer :initialize_logger do          Rails.logger ||= config.logger || begin -          path = config.paths.log.to_a.first +          path = config.paths["log"].first            logger = ActiveSupport::BufferedLogger.new(path)            logger.level = ActiveSupport::BufferedLogger.const_get(config.log_level.to_s.upcase)            logger.auto_flushing = false if Rails.env.production? diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index f902c3ded2..3505388479 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -9,7 +9,7 @@ module Rails                      :filter_parameters,  :log_level, :logger,                      :preload_frameworks, :reload_plugins,                      :secret_token, :serve_static_assets, :session_options, -                    :time_zone, :whiny_nils +                    :time_zone, :whiny_nils, :helpers_paths        def initialize(*)          super @@ -17,6 +17,7 @@ module Rails          @allow_concurrency = false          @consider_all_requests_local = false          @filter_parameters = [] +        @helpers_paths = []          @dependency_loading = true          @serve_static_assets = true          @session_store = :cookie_store @@ -60,13 +61,12 @@ module Rails        def paths          @paths ||= begin            paths = super -          paths.config.database     "config/database.yml" -          paths.config.environment  "config/environment.rb" -          paths.lib.templates       "lib/templates" -          paths.log                 "log/#{Rails.env}.log" -          paths.tmp                 "tmp" -          paths.tmp.cache           "tmp/cache" - +          paths.add "config/database",    :with => "config/database.yml" +          paths.add "config/environment", :with => "config/environment.rb" +          paths.add "lib/templates" +          paths.add "log",                :with => "log/#{Rails.env}.log" +          paths.add "tmp" +          paths.add "tmp/cache"            paths          end        end @@ -88,7 +88,7 @@ module Rails        # YAML::load.        def database_configuration          require 'erb' -        YAML::load(ERB.new(IO.read(paths.config.database.to_a.first)).result) +        YAML::load(ERB.new(IO.read(paths["config/database"].first)).result)        end        def cache_store diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index b95df467c7..e3342be7ee 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -4,7 +4,7 @@ module Rails        include Initializable        initializer :add_generator_templates do -        config.generators.templates.unshift(*paths.lib.templates.to_a) +        config.generators.templates.unshift(*paths["lib/templates"].existent)        end        initializer :ensure_autoload_once_paths_as_subset do diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index 6da903c1ac..1d1f5e1b06 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -1,17 +1,15 @@  module Rails    class Application      class RoutesReloader < ::ActiveSupport::FileUpdateChecker +      attr_reader :route_sets +        def initialize          super([]) { reload! } -      end - -      def blocks -        @blocks ||= {} +        @route_sets = []        end        def reload!          clear! -        load_blocks          load_paths          finalize!        ensure @@ -21,37 +19,27 @@ module Rails      protected        def clear! -        routers.each do |routes| +        route_sets.each do |routes|            routes.disable_clear_and_finalize = true            routes.clear!          end        end -      def load_blocks -        blocks.each do |routes, block| -          routes.draw(&block) if block -        end -      end -        def load_paths          paths.each { |path| load(path) }        end        def finalize! -        routers.each do |routes| +        route_sets.each do |routes|            ActiveSupport.on_load(:action_controller) { routes.finalize! }          end        end        def revert -        routers.each do |routes| +        route_sets.each do |routes|            routes.disable_clear_and_finalize = false          end        end - -      def routers -        blocks.keys -      end      end    end  end | 
