Module: OS

Defined in:
lib/subduino/os.rb

Class Method Summary collapse

Class Method Details

.bsd?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/subduino/os.rb', line 28

def bsd?
  OS.is? /bsd/
end

.is?(what) ⇒ Boolean Also known as: is

Returns:

  • (Boolean)


8
9
10
# File 'lib/subduino/os.rb', line 8

def is?(what)
  what === RbConfig::CONFIG['host_os']
end

.linux?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/subduino/os.rb', line 20

def linux?
  OS.is? /linux|cygwin/
end

.mac?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/subduino/os.rb', line 24

def mac?
  OS.is? /mac|darwin/
end

.posix?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/subduino/os.rb', line 40

def posix?
  linux? or mac? or bsd? or solaris? or Process.respond_to?(:fork)
end

.solaris?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/subduino/os.rb', line 36

def solaris?
  OS.is? /solaris|sunos/
end

.to_sObject



13
14
15
# File 'lib/subduino/os.rb', line 13

def to_s
  RbConfig::CONFIG['host_os']
end

.windows?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/subduino/os.rb', line 32

def windows?
  OS.is? /mswin|win|mingw/
end