Module: Mobilis::OS

Defined in:
lib/mobilis/os.rb

Class Method Summary collapse

Class Method Details

.jruby?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/mobilis/os.rb', line 21

def OS.jruby?
  RUBY_ENGINE == 'jruby'
end

.linux?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/mobilis/os.rb', line 17

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

.mac?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/mobilis/os.rb', line 9

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

.unix?Boolean

Returns:

  • (Boolean)


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

def OS.unix?
  !OS.windows?
end

.windows?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/mobilis/os.rb', line 5

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