Class: RSpecLive::FileWatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-live/file_watcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ FileWatcher

Returns a new instance of FileWatcher.



3
4
5
6
7
8
9
10
# File 'lib/rspec-live/file_watcher.rb', line 3

def initialize(path)
  @updated, @added, @removed = [], [], []
  Listen.to(path) do |updated, added, removed|
    @updated += updated
    @added += added
    @removed += removed
  end.start
end

Instance Method Details

#addedObject



16
17
18
# File 'lib/rspec-live/file_watcher.rb', line 16

def added
  queued_results @added
end

#removedObject



20
21
22
# File 'lib/rspec-live/file_watcher.rb', line 20

def removed
  queued_results @removed
end

#updatedObject



12
13
14
# File 'lib/rspec-live/file_watcher.rb', line 12

def updated
  queued_results @updated
end