aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/file_update_checker.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-16 00:54:39 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-16 09:01:48 -0300
commitc045eebd5d35259e65771de159966b7c20690d34 (patch)
tree7bac04c81569b7d6b462892e395bb7c105245750 /activesupport/lib/active_support/file_update_checker.rb
parent2afe12f05ca870437c08dfce8d9e2afb02f8b347 (diff)
downloadrails-c045eebd5d35259e65771de159966b7c20690d34.tar.gz
rails-c045eebd5d35259e65771de159966b7c20690d34.tar.bz2
rails-c045eebd5d35259e65771de159966b7c20690d34.zip
Remove deprecation from AS::Deprecation behavior, some minor cleanups
* Refactor log subscriber, use select! to avoid a new object * Remove deprecation messages related to AS::Deprecation behavior This was added about 2 years ago for Rails 3: https://github.com/rails/rails/commit/d4c7d3fd94e5a885a6366eaeb3b908bb58ffd4db * Remove some not used requires * Refactor delegate to avoid string conversions and if statements inside each block
Diffstat (limited to 'activesupport/lib/active_support/file_update_checker.rb')
-rw-r--r--activesupport/lib/active_support/file_update_checker.rb13
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