Class: RubyExts::Platform

Inherits:
Object show all
Defined in:
lib/rubyexts/platform.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rubyexts/platform.rb', line 14

def linux?
  self.match?("linux")
end

.match?(platform) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/rubyexts/platform.rb', line 6

def match?(platform)
  !! RUBY_PLATFORM.match(/#{platform}/i)
end

.osx?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rubyexts/platform.rb', line 18

def osx?
  self.match?("-darwin")
end

.unix?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rubyexts/platform.rb', line 22

def unix?
  self.linux? or self.osx?
end

.windows?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rubyexts/platform.rb', line 10

def windows?
  self.match?("mswin|mingw")
end