From 5c234ab8ed4659a74a6c47ce8337055a62f75eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 12 Dec 2011 14:39:22 +0100 Subject: Composition > inheritance. --- railties/lib/rails/application/routes_reloader.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb index 1d1f5e1b06..c1f435a3ee 100644 --- a/railties/lib/rails/application/routes_reloader.rb +++ b/railties/lib/rails/application/routes_reloader.rb @@ -1,13 +1,21 @@ module Rails class Application - class RoutesReloader < ::ActiveSupport::FileUpdateChecker + class RoutesReloader attr_reader :route_sets - def initialize - super([]) { reload! } + def initialize(updater=ActiveSupport::FileUpdateChecker) + @updater = updater.new([]) { reload! } @route_sets = [] end + def paths + @updater.paths + end + + def execute_if_updated + @updater.execute_if_updated + end + def reload! clear! load_paths -- cgit v1.2.3