Class: Docker_Sync::SyncStrategy::Native
- Inherits:
-
Object
- Object
- Docker_Sync::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.
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, ) @sync_name = sync_name @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., :red exit 1 end end |
Instance Method Details
#clean ⇒ Object
41 42 43 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 41 def clean delete_volume end |
#get_volume_name ⇒ Object
33 34 35 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 33 def get_volume_name @sync_name end |
#run ⇒ Object
25 26 27 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 25 def run create_volume end |
#start_container ⇒ Object
37 38 39 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 37 def start_container # noop end |
#stop ⇒ Object
45 46 47 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 45 def stop # noop end |
#sync ⇒ Object
29 30 31 |
# File 'lib/docker-sync/sync_strategy/native.rb', line 29 def sync # noop end |