diff options
Diffstat (limited to 'activesupport/lib/active_support/file_update_checker.rb')
-rw-r--r-- | activesupport/lib/active_support/file_update_checker.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb index 3ff249536e..fe22b9515b 100644 --- a/activesupport/lib/active_support/file_update_checker.rb +++ b/activesupport/lib/active_support/file_update_checker.rb @@ -1,5 +1,3 @@ -require "active_support/core_ext/array/extract_options" - module ActiveSupport # \FileUpdateChecker specifies the API used by Rails to watch files # and control reloading. The API depends on four methods: @@ -93,10 +91,10 @@ module ActiveSupport def updated_at #:nodoc: @updated_at || begin - all = [] - all.concat @files.select { |f| File.exists?(f) } + all = @files.select { |f| File.exists?(f) } all.concat Dir[@glob] if @glob - all.map { |path| File.mtime(path) }.max || Time.at(0) + all.map! { |path| File.mtime(path) } + all.max || Time.at(0) end end @@ -104,9 +102,8 @@ module ActiveSupport hash.freeze # Freeze so changes aren't accidently pushed return if hash.empty? - globs = [] - hash.each do |key, value| - globs << "#{escape(key)}/**/*#{compile_ext(value)}" + globs = hash.map do |key, value| + "#{escape(key)}/**/*#{compile_ext(value)}" end "{#{globs.join(",")}}" end |