Sha256: c9e3017d0d31560914ee06e394a7cd4e4df98a1f7251fbd728ef5ce68e0df915

Contents?: true

Size: 762 Bytes

Versions: 12

Compression:

Stored size: 762 Bytes

Contents

module DockerSync
  module Dependencies
    module Docker
      DOCKER_NOT_AVAILABLE = 'Could not find Docker. Please install it (see https://docs.docker.com/compose/install/) and try again.'.freeze
      DOCKER_NOT_RUNNING   = 'No docker daemon seems to be running. Did you start docker-engine / docker-for-mac / docker-machine?'.freeze

      def self.available?
        return @available if defined? @available
        @available = find_executable0('docker')
      end

      def self.running?
        return @running if defined? @running
        @running = system('docker ps &> /dev/null')
      end

      def self.ensure!
        raise(DOCKER_NOT_AVAILABLE) unless available?
        raise(DOCKER_NOT_RUNNING)   unless running?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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