Module: Preconditions
- Defined in:
- lib/docker-sync/preconditions.rb
Class Method Summary collapse
- .check_all_preconditions ⇒ Object
- .docker_available ⇒ Object
- .docker_running ⇒ Object
- .docker_sync_available ⇒ Object
- .fswatch_available ⇒ Object
- .rsync_available ⇒ Object
- .unison_available ⇒ Object
Class Method Details
.check_all_preconditions ⇒ Object
4 5 6 7 8 |
# File 'lib/docker-sync/preconditions.rb', line 4 def self.check_all_preconditions docker_available docker_running fswatch_available end |
.docker_available ⇒ Object
10 11 12 13 14 |
# File 'lib/docker-sync/preconditions.rb', line 10 def self.docker_available if (find_executable0 'docker').nil? raise('Could not find docker binary in path. Please install it, e.g. using "brew install docker" or install docker-for-mac') end end |
.docker_running ⇒ Object
16 17 18 19 20 21 |
# File 'lib/docker-sync/preconditions.rb', line 16 def self.docker_running `docker ps` if $?.exitstatus > 0 raise('No docker daemon seems to be running. Did you start your docker-for-mac / docker-machine?') end end |
.docker_sync_available ⇒ Object
29 30 31 32 33 |
# File 'lib/docker-sync/preconditions.rb', line 29 def self.docker_sync_available if (find_executable0 'docker-sync').nil? raise('No docker-sync available. Install it by "gem install docker-sync"') end end |
.fswatch_available ⇒ Object
23 24 25 26 27 |
# File 'lib/docker-sync/preconditions.rb', line 23 def self.fswatch_available if (find_executable0 'fswatch').nil? raise('No fswatch available. Install it by "brew install fswatch"') end end |
.rsync_available ⇒ Object
35 36 37 38 39 |
# File 'lib/docker-sync/preconditions.rb', line 35 def self.rsync_available if (find_executable0 'rsync').nil? raise('Could not find rsync binary in path. Please install it, e.g. using "brew install rsync"') end end |
.unison_available ⇒ Object
41 42 43 44 45 |
# File 'lib/docker-sync/preconditions.rb', line 41 def self.unison_available if (find_executable0 'unison').nil? raise('Could not find unison binary in path. Please install it, e.g. using "brew install unison"') end end |