Sha256: 52f46662846ba97ad7b4e6e3935bf570b59e284a38ccd94c6a5726a47140d2d2

Contents?: true

Size: 1.15 KB

Versions: 20

Compression:

Stored size: 1.15 KB

Contents

require 'thor/shell'
require 'docker-sync/execution'
require 'docker-sync/sync_strategy/unison'

module DockerSync
  module WatchStrategy
    class Unison
      include Execution

      @options
      @sync_name
      @watch_fork

      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 = DockerSync::SyncStrategy::Unison.new(@sync_name, @options)
      end

      def run
        @watch_fork = @unison.watch
      end

      def stop
        # Make sure @watch_fork is not nil otherwise a TypeError is thrown
        if @watch_fork
          Process.kill 'TERM', @watch_fork
          Process.wait @watch_fork
        end
      end

      def clean
      end

      def watch
      end

      def watch_options
      end

      def watch_fork
        return @watch_fork
      end

      def watch_thread
        return nil
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
docker-sync-1.0.5 lib/docker-sync/watch_strategy/unison.rb
docker-sync-1.0.4 lib/docker-sync/watch_strategy/unison.rb
docker-sync-1.0.3 lib/docker-sync/watch_strategy/unison.rb
docker-sync-1.0.2 lib/docker-sync/watch_strategy/unison.rb
docker-sync-1.0.1 lib/docker-sync/watch_strategy/unison.rb
docker-sync-1.0.0 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.7.2 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.7.1 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.7.0 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.6.0 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.14 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.13 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.11 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.11.pre.beta3 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.11.pre.beta2 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.11.pre.beta1 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.10 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.10.pre.beta1 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.9 lib/docker-sync/watch_strategy/unison.rb
docker-sync-0.5.8 lib/docker-sync/watch_strategy/unison.rb