Class: DockerSync::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.


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

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

  begin
    Dependencies::Docker.ensure!
  rescue StandardError => 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


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

def clean
  delete_volume
end

#get_volume_nameObject


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

def get_volume_name
  @sync_name
end

#runObject


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

def run
  create_volume
end

#start_containerObject


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

def start_container  # noop

end

#stopObject


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

def stop  # noop

end

#syncObject


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

def sync  # noop

end