Sha256: 0f4d1ce6e969eede6d5cbd1adf0ea7e5c4069d45fa0cbb4c0f37169521012f51

Contents?: true

Size: 1.25 KB

Versions: 15

Compression:

Stored size: 1.25 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!
      Fswatch.forbid! if config.fswatch_required?
    end

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
docker-sync-1.0.5 lib/docker-sync/dependencies.rb
docker-sync-1.0.4 lib/docker-sync/dependencies.rb
docker-sync-1.0.3 lib/docker-sync/dependencies.rb
docker-sync-1.0.2 lib/docker-sync/dependencies.rb
docker-sync-1.0.1 lib/docker-sync/dependencies.rb
docker-sync-1.0.0 lib/docker-sync/dependencies.rb
docker-sync-0.7.2 lib/docker-sync/dependencies.rb
docker-sync-0.7.1 lib/docker-sync/dependencies.rb
docker-sync-0.7.0 lib/docker-sync/dependencies.rb
docker-sync-0.6.0 lib/docker-sync/dependencies.rb
docker-sync-0.5.14 lib/docker-sync/dependencies.rb
docker-sync-0.5.13 lib/docker-sync/dependencies.rb
docker-sync-0.5.11 lib/docker-sync/dependencies.rb
docker-sync-0.5.11.pre.beta3 lib/docker-sync/dependencies.rb
docker-sync-0.5.11.pre.beta2 lib/docker-sync/dependencies.rb