Module: OS

Defined in:
lib/rake-extensions.rb

Overview

os detection

Class Method Summary collapse

Class Method Details

.jruby?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/rake-extensions.rb', line 23

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

.linux?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rake-extensions.rb', line 19

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

.mac?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rake-extensions.rb', line 11

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

.unix?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rake-extensions.rb', line 15

def OS.unix?
  !OS.windows?
end

.windows?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rake-extensions.rb', line 7

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