Class: Docker_Sync::SyncStrategy::Native

Inherits:
Object
  • Object
show all
Includes:
Thor::Shell
Defined in:
lib/docker-sync/sync_strategy/native.rb

Instance Method Summary collapse

Constructor Details

#initialize(sync_name, options) ⇒ Native

Returns a new instance of Native.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/docker-sync/sync_strategy/native.rb', line 12

def initialize(sync_name, options)
  @sync_name = sync_name
  @options = options

  begin
    DockerSync::Preconditions::Strategy.instance.docker_available
  rescue Exception => e
    say_status 'error', "#{@sync_name} has been configured to sync with native docker volume, but docker is not found", :red
    say_status 'error', e.message, :red
    exit 1
  end
end

Instance Method Details

#cleanObject



41
42
43
# File 'lib/docker-sync/sync_strategy/native.rb', line 41

def clean
  delete_volume
end

#get_volume_nameObject



33
34
35
# File 'lib/docker-sync/sync_strategy/native.rb', line 33

def get_volume_name
  @sync_name
end

#runObject



25
26
27
# File 'lib/docker-sync/sync_strategy/native.rb', line 25

def run
  create_volume
end

#start_containerObject



37
38
39
# File 'lib/docker-sync/sync_strategy/native.rb', line 37

def start_container
  # noop
end

#stopObject



45
46
47
# File 'lib/docker-sync/sync_strategy/native.rb', line 45

def stop
  # noop
end

#syncObject



29
30
31
# File 'lib/docker-sync/sync_strategy/native.rb', line 29

def sync
  # noop
end