Sha256: d791be476f99f9482343425435d7a5ac61f2de5b4e520615869c2e2e26d9a6c4

Contents?: true

Size: 1.15 KB

Versions: 12

Compression:

Stored size: 1.15 KB

Contents

require 'mkmf'
require 'thor/shell'

Dir[
  File.join(__dir__, 'dependencies', 'package_managers', 'base.rb'),
  File.join(__dir__, 'dependencies', '**', '*.rb')
].each { |f| require f }

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

    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

    def self.ensure_all_for_mac!(config)
      PackageManager.ensure!
      Docker.ensure!
      Unison.ensure!  if config.unison_required?
      Rsync.ensure!   if config.rsync_required?
      Fswatch.ensure! if config.fswatch_required?
    end

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
docker-sync-0.5.7 lib/docker-sync/dependencies.rb
docker-sync-0.5.6 lib/docker-sync/dependencies.rb
docker-sync-0.5.5 lib/docker-sync/dependencies.rb
docker-sync-0.5.4 lib/docker-sync/dependencies.rb
docker-sync-0.5.3 lib/docker-sync/dependencies.rb
docker-sync-0.5.2 lib/docker-sync/dependencies.rb
docker-sync-0.5.1 lib/docker-sync/dependencies.rb
docker-sync-0.5.0 lib/docker-sync/dependencies.rb
docker-sync-0.5.0.pre.rc1 lib/docker-sync/dependencies.rb
docker-sync-0.5.0.pre.beta3 lib/docker-sync/dependencies.rb
docker-sync-0.5.0.pre.beta2 lib/docker-sync/dependencies.rb
docker-sync-0.5.0.pre.beta1 lib/docker-sync/dependencies.rb