Class: Kitchen::Driver::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/driver/docker_ssh.rb

Overview

helper class

Class Method Summary collapse

Class Method Details

.env_error_redirectObject



396
397
398
399
400
401
402
# File 'lib/kitchen/driver/docker_ssh.rb', line 396

def self.env_error_redirect
  if os == :windows
    "2> NUL"
  else
    "2> /dev/null"
  end
end

.osObject



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/kitchen/driver/docker_ssh.rb', line 378

def self.os
  @os ||= (
    host_os = RbConfig::CONFIG['host_os']
    case host_os
    when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
      :windows
    when /darwin|mac os/
      :macosx
    when /linux/
      :linux
    when /solaris|bsd/
      :unix
    else
      raise UserError, "unknown os: #{host_os.inspect}"
    end
    )
end