Created
February 1, 2011 00:13
-
-
Save rares/805124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cool.io" | |
class MyStatWatcher < Coolio::StatWatcher | |
def initialize(path, interval) | |
super | |
end | |
def on_change | |
puts path | |
end | |
end | |
path = ARGV[0] || "." | |
increment = ARGV[1] || 1 | |
Cool.io::Loop.default.tap do |reactor| | |
MyStatWatcher.new(path, increment).tap do |watcher| | |
watcher.attach(reactor) | |
end | |
end.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment