Class: DockerSync::SyncStrategy::Native
- Inherits:
-
Object
- Object
- DockerSync::SyncStrategy::Native
- Includes:
- Thor::Shell
- Defined in:
- lib/docker-sync/sync_strategy/native.rb
Instance Method Summary collapse
- #clean ⇒ Object
- #get_volume_name ⇒ Object
-
#initialize(sync_name, options) ⇒ Native
constructor
A new instance of Native.
- #run ⇒ Object
- #start_container ⇒ Object
- #stop ⇒ Object
- #sync ⇒ Object
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, ) @sync_name = sync_name @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., :red exit 1 end end |
Instance Method Details
#clean ⇒ Object
40 41 42 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 40 def clean delete_volume end |
#get_volume_name ⇒ Object
32 33 34 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 32 def get_volume_name @sync_name end |
#run ⇒ Object
24 25 26 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 24 def run create_volume end |
#start_container ⇒ Object
36 37 38 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 36 def start_container # noop end |
#stop ⇒ Object
44 45 46 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 44 def stop # noop end |
#sync ⇒ Object
28 29 30 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 28 def sync # noop end |