diff --git a/.gitignore b/.gitignore index c1e0daf..e0365dc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,14 @@ tmtags ## VIM *.swp +## GLADIATOR +.gladiator +.gladiator-scratchpad + +## RVM +.ruby-version +.ruby-gemset + ## PROJECT::GENERAL coverage rdoc diff --git a/README.md b/README.md index aea9a01..2cb7748 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ require 'os' >> OS.mac? # or OS.osx? or OS.x? => false +>> OS.mac_version # or OS.osx_version or OS.x_version +=> 12.5 # Monterey + >> OS.dev_null => "NUL" # or "/dev/null" depending on which platform diff --git a/lib/os.rb b/lib/os.rb index c65764d..1d1f6be 100644 --- a/lib/os.rb +++ b/lib/os.rb @@ -132,6 +132,17 @@ def self.x? mac? end + def self.mac_version + `sw_vers -productVersion`.chomp if mac? + end + + def self.osx_version + mac_version + end + + def self.x_version + mac_version + end # amount of memory the current process "is using", in RAM # (doesn't include any swap memory that it may be using, just that in actual RAM)