Is there a way to detect the operating system in ruby? I am working on developing a sketchup tool that will need to detect Mac vs. Windows.
You can use the os
gem:
gem install os
And then
require 'os'
OS.linux? #=> true or false
OS.windows? #=> true or false
OS.java? #=> true or false
OS.bsd? #=> true or false
OS.mac? #=> true or false
# and so on.