From: "Berger, Daniel" Date: 2005-06-29T22:54:11+09:00 Subject: Re: Smart(er) platform detection > -----Original Message----- > From: Matt Mower [mailto:matt.mower@gmail.com] > Sent: Wednesday, June 29, 2005 4:16 AM > To: ruby-talk ML > Subject: Smart(er) platform detection > > > Hi folks, > > I recently got bitten by some code which uses an idiom like: > > if RUBY_PLATFORM =~ /win/i > # windows stuff here > end > > which is fine until you try it on a machine (like my shiny new > PowerBook) whose platform string is: > > powerpc-darwin-8.1.0 > > I looked around and couldn't find a systematic solution to > getting useful information from RUBY_PLATFORM so I quickly > hacked something together which you can find described at: Please see sys-uname. Regards, Dan