aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/file_watcher.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-08-07 16:10:20 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-08-07 16:10:20 -0700
commit089661b69ad055cab68ea860c085c7f852da3972 (patch)
treea39fe35f3c399b199bdca8490724b451761a1cba /activesupport/lib/active_support/file_watcher.rb
parentcc1de71bfaced172fe00a66fd381da69d9528e8b (diff)
parente81453ef92b37156dafc092093106c8e8b87b268 (diff)
downloadrails-089661b69ad055cab68ea860c085c7f852da3972.tar.gz
rails-089661b69ad055cab68ea860c085c7f852da3972.tar.bz2
rails-089661b69ad055cab68ea860c085c7f852da3972.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib/active_support/file_watcher.rb')
-rw-r--r--activesupport/lib/active_support/file_watcher.rb36
1 files changed, 0 insertions, 36 deletions
diff --git a/activesupport/lib/active_support/file_watcher.rb b/activesupport/lib/active_support/file_watcher.rb
deleted file mode 100644
index 81e63e76a7..0000000000
--- a/activesupport/lib/active_support/file_watcher.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-module ActiveSupport
- class FileWatcher
- class Backend
- def initialize(path, watcher)
- @watcher = watcher
- @path = path
- end
-
- def trigger(files)
- @watcher.trigger(files)
- end
- end
-
- def initialize
- @regex_matchers = {}
- end
-
- def watch(pattern, &block)
- @regex_matchers[pattern] = block
- end
-
- 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 |pattern, block|
- trigger_files[block][state] << file if pattern === file
- end
- end
-
- trigger_files.each do |block, payload|
- block.call payload
- end
- end
- end
-end