diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-08 10:48:01 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-08 10:48:01 -0800 |
commit | 51414a0893096709cdc3d02c72d6bfb67fa43319 (patch) | |
tree | fab0d2e07d536678c38ff210ba9fcd90cbc52d50 /activesupport | |
parent | 1df3b65acccaee908b6a579640f5060094fad8c0 (diff) | |
download | rails-51414a0893096709cdc3d02c72d6bfb67fa43319.tar.gz rails-51414a0893096709cdc3d02c72d6bfb67fa43319.tar.bz2 rails-51414a0893096709cdc3d02c72d6bfb67fa43319.zip |
use === so that regular expressions are not required
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/file_watcher.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/file_watcher.rb b/activesupport/lib/active_support/file_watcher.rb index 81b4b117c1..81e63e76a7 100644 --- a/activesupport/lib/active_support/file_watcher.rb +++ b/activesupport/lib/active_support/file_watcher.rb @@ -15,17 +15,16 @@ module ActiveSupport @regex_matchers = {} end - def watch_regex(regex, &block) - @regex_matchers[regex] = block + def watch(pattern, &block) + @regex_matchers[pattern] = block end - alias :watch :watch_regex def trigger(files) trigger_files = Hash.new { |h,k| h[k] = Hash.new { |h2,k2| h2[k2] = [] } } files.each do |file, state| - @regex_matchers.each do |regex, block| - trigger_files[block][state] << file if regex === file + @regex_matchers.each do |pattern, block| + trigger_files[block][state] << file if pattern === file end end |