Class: DockerSync::WatchStrategy::Remote_logs

Inherits:
Object
  • Object
show all
Includes:
Execution, Thor::Shell
Defined in:
lib/docker-sync/watch_strategy/remotelogs.rb

Instance Method Summary collapse

Methods included from Execution

#fork_exec, #thread_exec, #with_time

Constructor Details

#initialize(sync_name, options) ⇒ Remote_logs

Returns a new instance of Remote_logs.



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

def initialize(sync_name, options)
  @options = options
  @sync_name = sync_name
  @watch_fork = nil
  @watch_thread = nil
  @unison = DockerSync::SyncStrategy::NativeOsx.new(@sync_name, @options)
end

Instance Method Details

#cleanObject



32
33
# File 'lib/docker-sync/watch_strategy/remotelogs.rb', line 32

def clean
end

#runObject



23
24
25
26
27
# File 'lib/docker-sync/watch_strategy/remotelogs.rb', line 23

def run
  say_status 'success', "Showing unison logs from your sync container: #{@unison.get_container_name}", :green
  cmd = "docker exec #{@unison.get_container_name} tail -F /tmp/unison.log"
  @watch_thread = thread_exec(cmd, 'Sync Log:')
end

#stopObject



29
30
# File 'lib/docker-sync/watch_strategy/remotelogs.rb', line 29

def stop
end

#watchObject



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

def watch
end

#watch_forkObject



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

def watch_fork
  return @watch_fork
end

#watch_optionsObject



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

def watch_options
end

#watch_threadObject



45
46
47
# File 'lib/docker-sync/watch_strategy/remotelogs.rb', line 45

def watch_thread
  return @watch_thread
end