↧
Answer by Darshan Rivka Whittle for What's the best-practice way to find out...
There's always:begin require 'win32console'rescue LoadErrorendI find this easier to write and reason about that trying to decide for myself which OS I'm on and whether or not to load it.Update: I was...
View ArticleAnswer by peter for What's the best-practice way to find out the platform...
Nothing wrong with using RUBY_PLATFORM, it is its purpose.You could also ask it the OS itself, for windows that would beENV['OS']Which gives "Windows_NT" on a Vista.Don't know the counterpart for the...
View ArticleWhat's the best-practice way to find out the platform ruby is running on?
I am using colored gem for coloured printing in the terminal and ruby logger. I need to run this code on linux and on windows. On windows, I must first require 'win32console' or else coloured printing...
View Article