Class: Docker_Sync::WatchStrategy::Unison
- Inherits:
-
Object
- Object
- Docker_Sync::WatchStrategy::Unison
- Includes:
- Execution
- Defined in:
- lib/docker-sync/watch_strategy/unison.rb
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(sync_name, options) ⇒ Unison
constructor
A new instance of Unison.
- #run ⇒ Object
- #stop ⇒ Object
- #watch ⇒ Object
- #watch_fork ⇒ Object
- #watch_options ⇒ Object
- #watch_thread ⇒ Object
Methods included from Execution
Constructor Details
#initialize(sync_name, options) ⇒ Unison
Returns a new instance of Unison.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 14 def initialize(sync_name, ) @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
#clean ⇒ Object
34 35 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 34 def clean end |
#run ⇒ Object
25 26 27 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 25 def run @watch_fork = @unison.watch end |
#stop ⇒ Object
29 30 31 32 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 29 def stop Process.kill 'TERM', @watch_fork Process.wait @watch_fork end |
#watch ⇒ Object
37 38 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 37 def watch end |
#watch_fork ⇒ Object
43 44 45 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 43 def watch_fork return @watch_fork end |
#watch_options ⇒ Object
40 41 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 40 def end |
#watch_thread ⇒ Object
47 48 49 |
# File 'lib/docker-sync/watch_strategy/unison.rb', line 47 def watch_thread return nil end |