Permalink
Browse files

use === so that regular expressions are not required

  • Loading branch information...
1 parent 1df3b65 commit 51414a0893096709cdc3d02c72d6bfb67fa43319 @tenderlove tenderlove committed Feb 8, 2011
Showing with 4 additions and 5 deletions.
  1. +4 −5 activesupport/lib/active_support/file_watcher.rb
@@ -15,17 +15,16 @@ def initialize
@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

0 comments on commit 51414a0

Please sign in to comment.