Class: LiveUpdaterActor

Inherits:
Object show all
Includes:
BasicActor
Defined in:
lib/live_updater_actor.rb

Instance Method Summary collapse

Methods included from BasicActor

included

Constructor Details

#initializeLiveUpdaterActor

Returns a new instance of LiveUpdaterActor.



8
9
10
11
# File 'lib/live_updater_actor.rb', line 8

def initialize
  @listener = build
  start
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
20
# File 'lib/live_updater_actor.rb', line 13

def build
  Listen.to($LIVE_UPDATE_WATCH_PATH) do |modified, added, removed|
    debug_message "modified absolute path: #{modified}"
    debug_message "added absolute path: #{added}"
    debug_message "removed absolute path: #{removed}"
    publish "refresh"
  end
end

#startObject



22
23
24
# File 'lib/live_updater_actor.rb', line 22

def start
  @listener.start
end

#stopObject



26
27
28
# File 'lib/live_updater_actor.rb', line 26

def stop
  @listener.stop
end