Class: Docker_Sync::WatchStrategy::Unison

Inherits:
Object
  • Object
show all
Includes:
Execution
Defined in:
lib/docker-sync/watch_strategy/unison.rb

Instance Method Summary collapse

Methods included from Execution

#forkexec, #threadexec

Constructor Details

#initialize(sync_name, options) ⇒ Unison

Returns a new instance of Unison.



15
16
17
18
19
20
21
22
23
24
# File 'lib/docker-sync/watch_strategy/unison.rb', line 15

def initialize(sync_name, options)
  @options = options
  @sync_name = sync_name
  @watch_fork = nil
  # instantiate the sync task to easily access all common parameters between
  # unison sync and watch
  # basically unison watch is the command with the additionnal -repeat watch option
  # note: this doesn't run a sync
  @unison = Docker_Sync::SyncStrategy::Unison.new(@sync_name, @options)
end

Instance Method Details

#cleanObject



35
36
# File 'lib/docker-sync/watch_strategy/unison.rb', line 35

def clean
end

#runObject



26
27
28
# File 'lib/docker-sync/watch_strategy/unison.rb', line 26

def run
  @watch_fork = @unison.watch
end

#stopObject



30
31
32
33
# File 'lib/docker-sync/watch_strategy/unison.rb', line 30

def stop
  Process.kill 'TERM', @watch_fork
  Process.wait @watch_fork
end

#watchObject



38
39
# File 'lib/docker-sync/watch_strategy/unison.rb', line 38

def watch
end

#watch_forkObject



44
45
46
# File 'lib/docker-sync/watch_strategy/unison.rb', line 44

def watch_fork
  return @watch_fork
end

#watch_optionsObject



41
42
# File 'lib/docker-sync/watch_strategy/unison.rb', line 41

def watch_options
end

#watch_threadObject



48
49
50
# File 'lib/docker-sync/watch_strategy/unison.rb', line 48

def watch_thread
  return nil
end