Class: RhoDevelopment::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/build/development/platform.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/build/development/platform.rb', line 11

def self.linux?
  return /linux/i === RbConfig::CONFIG['host_os']
end

.osx?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/build/development/platform.rb', line 7

def self.osx?
  return /darwin/i === RbConfig::CONFIG['host_os']
end

.terminate_process(pid) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/build/development/platform.rb', line 15

def self.terminate_process(pid)
  if self.windows?
    system "taskkill /F /PID #{pid}"
  elsif self.osx? or self.linux?
    Process.kill('SIGTERM', pid)
  else
    raise "Unknown platform #{RbConfig::CONFIG['host_os']}"
  end
end

.windows?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/build/development/platform.rb', line 3

def self.windows?
  return /mswin|mingw32|windows/i === RbConfig::CONFIG['host_os']
end