Class: Watch

Inherits:
Object
  • Object
show all
Defined in:
lib/watch.rb

Instance Method Summary collapse

Constructor Details

#initialize(glob, &block) ⇒ Watch

Returns a new instance of Watch.



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/watch.rb', line 2

def initialize(glob, &block)
  raise "must pass a block" unless block_given?
  
  @path = glob
  @files = []
  @block = block
  
  @block.call
  
  run_loop
end