Class: KiskoSuits::Watcher

Inherits:
Object
  • Object
show all
Defined in:
lib/kisko-suits/watcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(initial_filename, on_update) ⇒ Watcher

Returns a new instance of Watcher.



7
8
9
10
11
# File 'lib/kisko-suits/watcher.rb', line 7

def initialize(initial_filename, on_update)
  @initial_filename = initial_filename
  @on_update = on_update
  @watched_paths = Set.new
end

Instance Attribute Details

#initial_filenameObject (readonly)

Returns the value of attribute initial_filename.



5
6
7
# File 'lib/kisko-suits/watcher.rb', line 5

def initial_filename
  @initial_filename
end

#on_updateObject (readonly)

Returns the value of attribute on_update.



5
6
7
# File 'lib/kisko-suits/watcher.rb', line 5

def on_update
  @on_update
end

#watched_pathsObject (readonly)

Returns the value of attribute watched_paths.



5
6
7
# File 'lib/kisko-suits/watcher.rb', line 5

def watched_paths
  @watched_paths
end

Instance Method Details

#startObject



13
14
15
16
17
# File 'lib/kisko-suits/watcher.rb', line 13

def start
  process_path(initial_filename)
  add_path(initial_filename)
  watch
end