Module: Bowline::Platform
- Defined in:
- lib/bowline/platform.rb
Overview
Naive platform detection for Ruby
Based on code by Matt Mower <self@mattmower.com> matt.blogs.it/gems/ruby/platform.rb
Constant Summary
Instance Method Summary (collapse)
- - (Boolean) linux?
- - (Boolean) osx?
-
- (Object) type
Return OS type.
- - (Boolean) win32?
Instance Method Details
- (Boolean) linux?
53 54 55 |
# File 'lib/bowline/platform.rb', line 53 def linux? IMPL == :linux end |
- (Boolean) osx?
48 49 50 |
# File 'lib/bowline/platform.rb', line 48 def osx? IMPL == :macosx end |
- (Object) type
Return OS type. An error is raised on platforms unsupported by Bowline. Example:
Bowline::Platform.type # => :osx
67 68 69 70 71 72 |
# File 'lib/bowline/platform.rb', line 67 def type return :osx if osx? return :linux if linux? return :win32 if win32? raise "Unknown platform" end |
- (Boolean) win32?
58 59 60 |
# File 'lib/bowline/platform.rb', line 58 def win32? OS == :win32 end |