Class: Utils::OS

Inherits:
Object
  • Object
show all
Defined in:
lib/machineid/OS.rb

Instance Method Summary collapse

Instance Method Details

#jruby?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/machineid/OS.rb', line 19

def jruby?
    RUBY_ENGINE == 'jruby'
end

#linux?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/machineid/OS.rb', line 15

def linux?
    self.unix? and not self.mac?
end

#mac?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/machineid/OS.rb', line 7

def mac?
    (/darwin/ =~ RUBY_PLATFORM) != nil
end

#unix?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/machineid/OS.rb', line 11

def unix?
    self.windows?
end

#windows?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/machineid/OS.rb', line 3

def windows?
    (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end