Module: DockerSync::Dependencies

Defined in:
lib/docker-sync/dependencies.rb,
lib/docker-sync/dependencies/unox.rb,
lib/docker-sync/dependencies/rsync.rb,
lib/docker-sync/dependencies/docker.rb,
lib/docker-sync/dependencies/unison.rb,
lib/docker-sync/dependencies/fswatch.rb,
lib/docker-sync/dependencies/docker_driver.rb,
lib/docker-sync/dependencies/package_manager.rb,
lib/docker-sync/dependencies/package_managers/apt.rb,
lib/docker-sync/dependencies/package_managers/pkg.rb,
lib/docker-sync/dependencies/package_managers/yum.rb,
lib/docker-sync/dependencies/package_managers/base.rb,
lib/docker-sync/dependencies/package_managers/brew.rb,
lib/docker-sync/dependencies/package_managers/none.rb

Defined Under Namespace

Modules: Docker, Fswatch, PackageManager, Rsync, Unison, Unox

Constant Summary collapse

UNSUPPORTED_OPERATING_SYSTEM =
'Unsupported operating system. Are you sure you need DockerSync?'.freeze

Class Method Summary collapse

Class Method Details

.ensure_all!(config) ⇒ Object


13
14
15
16
17
18
19
# File 'lib/docker-sync/dependencies.rb', line 13

def self.ensure_all!(config)
  return if ENV['DOCKER_SYNC_SKIP_DEPENDENCIES_CHECK']
  return ensure_all_for_mac!(config)   if Environment.mac?
  return ensure_all_for_linux!(config) if Environment.linux?
  return ensure_all_for_freebsd!(config) if Environment.freebsd?
  raise(UNSUPPORTED_OPERATING_SYSTEM)
end

.ensure_all_for_freebsd!(config) ⇒ Object


40
41
42
43
44
# File 'lib/docker-sync/dependencies.rb', line 40

def self.ensure_all_for_freebsd!(config)
  Docker.ensure!
  Unison.ensure!  if config.unison_required?
  Rsync.ensure!   if config.rsync_required?
end

.ensure_all_for_linux!(_config) ⇒ Object


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

def self.ensure_all_for_linux!(_config)
  Docker.ensure!
end

.ensure_all_for_mac!(config) ⇒ Object


21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/docker-sync/dependencies.rb', line 21

def self.ensure_all_for_mac!(config)
  PackageManager.ensure!
  Docker.ensure!
  Unison.ensure!  if config.unison_required?
  Rsync.ensure!   if config.rsync_required?
  if config.fswatch_required?
    unless Fswatch.available?
      Fswatch.ensure!
      puts "please restart docker sync so the installation of fswatch takes effect"
      raise(UNSUPPORTED_OPERATING_SYSTEM)
    end
  end

end