Sha256: 5a4e5beafdfab71cb04d14aa478607fd87a546bfdaca9e2397901df194d06b04

Contents?: true

Size: 975 Bytes

Versions: 7

Compression:

Stored size: 975 Bytes

Contents

module DockerSync
  module Dependencies
    module Docker
      module Driver
        def self.docker_for_mac?
          return false unless Environment.mac?
          return @docker_for_mac if defined? @docker_for_mac

          # com.docker.hyperkit for old virtualization engine
          # com.docker.virtualization for new virtualization engine
          # see https://docs.docker.com/desktop/mac/#enable-the-new-apple-virtualization-framework
          @docker_for_mac = Environment.system('pgrep -q com.docker.hyperkit') || Environment.system('pgrep -q com.docker.virtualization')
        end

        def self.docker_toolbox?
          return false unless Environment.mac? || Environment.freebsd?
          return false unless find_executable0('docker-machine')
          return @docker_toolbox if defined? @docker_toolbox
          @docker_toolbox = Environment.system('docker info | grep -q "Operating System: Boot2Docker"')
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
docker-sync-1.0.5 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-1.0.4 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-1.0.3 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-1.0.2 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-1.0.1 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-1.0.0 lib/docker-sync/dependencies/docker_driver.rb
docker-sync-0.7.2 lib/docker-sync/dependencies/docker_driver.rb