Class: Slippery::WatchTask
- Inherits:
-
Object
- Object
- Slippery::WatchTask
- Defined in:
- lib/slippery/rake_tasks.rb
Instance Method Summary collapse
-
#initialize(name, files, &block) ⇒ WatchTask
constructor
A new instance of WatchTask.
- #notifier ⇒ Object
Constructor Details
#initialize(name, files, &block) ⇒ WatchTask
Returns a new instance of WatchTask.
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/slippery/rake_tasks.rb', line 96 def initialize(name, files, &block) Rake::Task.define_task name do Array(files).each do |pattern| notifier.watch(pattern, :modify, &block) end at_exit do block.call notifier.run end end end |
Instance Method Details
#notifier ⇒ Object
108 109 110 |
# File 'lib/slippery/rake_tasks.rb', line 108 def notifier @notifier ||= INotify::Notifier.new end |