Refactor RoutesReloader a bit to avoid creating extra hash objects

This commit is contained in:
Carlos Antonio da Silva 2012-04-28 12:57:39 -03:00
parent af024f4b1e
commit 72a2edd8c3
1 changed files with 2 additions and 3 deletions

View File

@ -24,12 +24,11 @@ module Rails
def updater
@updater ||= begin
dirs = @external_routes.inject({}) do |hash, dir|
hash.merge(dir.to_s => ["rb"])
dirs = @external_routes.each_with_object({}) do |dir, hash|
hash[dir.to_s] = %w(rb)
end
updater = ActiveSupport::FileUpdateChecker.new(paths, dirs) { reload! }
updater.execute
updater
end