class RakeCompilerDock::DockerCheck

def initialize(io, pwd, machine_name="rake-compiler-dock")

def initialize(io, pwd, machine_name="rake-compiler-dock")
  @io = io
  @pwd = pwd
  @machine_name = machine_name
  if !io.tty? || (RUBY_PLATFORM=~/mingw|mswin/ && RUBY_VERSION[/^\d+/] < '2')
    disable_colors
  else
    enable_colors
  end
  docker_version
  unless ok?
    doma_version
    if doma_avail?
      io.puts
      io.puts yellow("docker-machine is available, but not ready to use. Trying to start.")
      doma_create
      if doma_create_ok?
        doma_start
        docker_version
      end
    else
      b2d_version
      if b2d_avail?
        io.puts
        io.puts yellow("boot2docker is available, but not ready to use. Trying to start.")
        b2d_init
        if b2d_init_ok?
          b2d_start
          docker_version
        end
      end
    end
  end
end