Class: Burn::Util::Os
- Inherits:
-
Object
- Object
- Burn::Util::Os
- Defined in:
- lib/burn/util/os.rb
Instance Method Summary collapse
-
#initialize ⇒ Os
constructor
A new instance of Os.
- #is_linux? ⇒ Boolean
- #is_mac? ⇒ Boolean
- #is_win? ⇒ Boolean
- #name ⇒ Object
Constructor Details
#initialize ⇒ Os
Returns a new instance of Os.
7 8 9 |
# File 'lib/burn/util/os.rb', line 7 def initialize @name = RbConfig::CONFIG['host_os'] end |
Instance Method Details
#is_linux? ⇒ Boolean
21 22 23 24 |
# File 'lib/burn/util/os.rb', line 21 def is_linux? return true if @name =~ /linux|cygwin|bsd|solaris|sunos/ false end |
#is_mac? ⇒ Boolean
16 17 18 19 |
# File 'lib/burn/util/os.rb', line 16 def is_mac? return true if @name =~ /mac|darwin/ false end |
#is_win? ⇒ Boolean
11 12 13 14 |
# File 'lib/burn/util/os.rb', line 11 def is_win? return true if @name =~ /mswin(?!ce)|mingw|bccwin/ false end |
#name ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/burn/util/os.rb', line 26 def name if is_win? then "win" elsif is_mac? then "mac" else "other" end end |