diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-24 09:00:18 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-24 09:32:54 +0100 |
commit | 2fde9d774b322fc708990675671231c64c691a33 (patch) | |
tree | f38713fcab2e54cf4ad34652042df34864608440 /railties/lib/rails/application | |
parent | d3c40242a58a8863cd216f6639f93df5fdb0c075 (diff) | |
download | rails-2fde9d774b322fc708990675671231c64c691a33.tar.gz rails-2fde9d774b322fc708990675671231c64c691a33.tar.bz2 rails-2fde9d774b322fc708990675671231c64c691a33.zip |
Solve some pendencies.
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/application/railties.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/application/routes_reloader.rb | 13 |
3 files changed, 8 insertions, 9 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 2ac881ac11..db19011b7f 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -17,7 +17,7 @@ module Rails initializer :add_builtin_route do |app| if Rails.env.development? - app.config.action_dispatch.route_files << File.join(RAILTIES_PATH, 'builtin', 'routes.rb') + app.config.action_dispatch.route_paths << File.join(RAILTIES_PATH, 'builtin', 'routes.rb') end end diff --git a/railties/lib/rails/application/railties.rb b/railties/lib/rails/application/railties.rb index d167d9bf4f..b3e6693f89 100644 --- a/railties/lib/rails/application/railties.rb +++ b/railties/lib/rails/application/railties.rb @@ -1,7 +1,7 @@ module Rails class Application class Railties - # TODO Write tests + # TODO Write tests for this behavior extracted from Application def initialize(config) @config = config end diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index 6d61de2320..d861d27465 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -1,8 +1,7 @@ module Rails class Application class RoutesReloader - # TODO Change config.action_dispatch.route_files to config.action_dispatch.routes_path - # TODO Write tests + # TODO Write tests for this behavior extracted from Application def initialize(config) @config, @last_change_at = config, nil end @@ -10,8 +9,8 @@ module Rails def changed_at routes_changed_at = nil - files.each do |file| - config_changed_at = File.stat(file).mtime + paths.each do |path| + config_changed_at = File.stat(path).mtime if routes_changed_at.nil? || config_changed_at > routes_changed_at routes_changed_at = config_changed_at @@ -26,7 +25,7 @@ module Rails routes.disable_clear_and_finalize = true routes.clear! - files.each { |file| load(file) } + paths.each { |path| load(path) } routes.finalize! nil @@ -42,8 +41,8 @@ module Rails end end - def files - @config.action_dispatch.route_files + def paths + @config.action_dispatch.route_paths end end end |