diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-09-29 20:05:34 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-30 09:47:06 +0200 |
commit | 3049e645e5037cd923d0bad3c41c105dd9d791f8 (patch) | |
tree | e62c561d47e0861e30510ba932de12a12f33a7ef /railties/lib/rails/routes_reloader.rb | |
parent | 6648babdedb8cb9494dec69d2f7efac3da1d239c (diff) | |
download | rails-3049e645e5037cd923d0bad3c41c105dd9d791f8.tar.gz rails-3049e645e5037cd923d0bad3c41c105dd9d791f8.tar.bz2 rails-3049e645e5037cd923d0bad3c41c105dd9d791f8.zip |
Moved Rails::RoutesReloader to Rails::Application::RoutesReloader
Diffstat (limited to 'railties/lib/rails/routes_reloader.rb')
-rw-r--r-- | railties/lib/rails/routes_reloader.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/railties/lib/rails/routes_reloader.rb b/railties/lib/rails/routes_reloader.rb deleted file mode 100644 index 9cfc38630d..0000000000 --- a/railties/lib/rails/routes_reloader.rb +++ /dev/null @@ -1,54 +0,0 @@ -module Rails - class RoutesReloader < ::ActiveSupport::FileUpdateChecker - def initialize - super([]) { reload! } - end - - def blocks - @blocks ||= {} - end - private - def reload! - clear! - load_blocks - load_paths - finalize! - ensure - revert - end - - def clear! - routers.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| - ActiveSupport.on_load(:action_controller) { routes.finalize! } - end - end - - def revert - routers.each do |routes| - routes.disable_clear_and_finalize = false - end - end - - def routers - blocks.keys - end - end -end - |