diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 13 | ||||
-rw-r--r-- | railties/lib/rails/engine.rb | 7 | ||||
-rw-r--r-- | railties/lib/rails/engine/configuration.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/paths.rb | 10 |
4 files changed, 6 insertions, 25 deletions
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index 19f616ec50..6f9a200aa9 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -3,13 +3,12 @@ require "active_support/core_ext/module/delegation" module Rails class Application class RoutesReloader - attr_reader :route_sets, :paths, :external_routes + attr_reader :route_sets, :paths delegate :execute_if_updated, :execute, :updated?, :to => :updater def initialize - @paths = [] - @route_sets = [] - @external_routes = [] + @paths = [] + @route_sets = [] end def reload! @@ -24,11 +23,7 @@ module Rails def updater @updater ||= begin - dirs = @external_routes.each_with_object({}) do |dir, hash| - hash[dir.to_s] = %w(rb) - end - - updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! } + updater = ActiveSupport::FileUpdateChecker.new(paths) { reload! } updater.execute updater end diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 309d265477..383c159d3d 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -508,10 +508,7 @@ module Rails # Defines the routes for this engine. If a block is given to # routes, it is appended to the engine. def routes - @routes ||= ActionDispatch::Routing::RouteSet.new.tap do |routes| - routes.draw_paths.concat paths["config/routes"].paths - end - + @routes ||= ActionDispatch::Routing::RouteSet.new @routes.append(&Proc.new) if block_given? @routes end @@ -555,12 +552,10 @@ module Rails initializer :add_routing_paths do |app| paths = self.paths["config/routes.rb"].existent - external_paths = self.paths["config/routes"].paths if routes? || paths.any? app.routes_reloader.paths.unshift(*paths) app.routes_reloader.route_sets << routes - app.routes_reloader.external_routes.unshift(*external_paths) end end diff --git a/railties/lib/rails/engine/configuration.rb b/railties/lib/rails/engine/configuration.rb index e31df807a6..6b18b1e249 100644 --- a/railties/lib/rails/engine/configuration.rb +++ b/railties/lib/rails/engine/configuration.rb @@ -53,7 +53,6 @@ module Rails paths.add "config/initializers", :glob => "**/*.rb" paths.add "config/locales", :glob => "*.{rb,yml}" paths.add "config/routes.rb" - paths.add "config/routes", :glob => "**/*.rb" paths.add "db" paths.add "db/migrate" paths.add "db/seeds.rb" diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 6cd9c7bc95..9b4a69f19f 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -114,7 +114,7 @@ module Rails class Path include Enumerable - attr_reader :path, :root + attr_reader :path attr_accessor :glob def initialize(root, current, paths, options = {}) @@ -180,14 +180,6 @@ module Rails @paths end - def paths - raise "You need to set a path root" unless @root.path - - map do |p| - File.join @root.path, p - end - end - # Expands all paths against the root and return all unique values. def expanded raise "You need to set a path root" unless @root.path |