Install.rb problem - ri and rdoc think OS X is windows!

Aarrgh… my fault. I’ll fix 'em, but… what’s canonical way of
deciding that I’m on a Windows box?

Cheers

Dave

···

On Saturday, Mar 8, 2003, at 17:41 US/Central, Sam Roberts wrote:

I think this is the problem:

opfile += “.rb” if CONFIG[“target_os”] =~ /win/

Hi,

···

At Sun, 9 Mar 2003 09:12:25 +0900, Dave Thomas wrote:

Aarrgh… my fault. I’ll fix 'em, but… what’s canonical way of
deciding that I’m on a Windows box?

Although there’s no “canonical” way, what about this?

File::ALT_SEPARATOR == ‘\’ and /win/ =~ RUBY_PLATFORM


Nobu Nakada

“Dave Thomas” dave@pragprog.com wrote in message
news:CE084DEF-51C3-11D7-93A9-000A95676A62@pragprog.com

I think this is the problem:

opfile += “.rb” if CONFIG[“target_os”] =~ /win/

Aarrgh… my fault. I’ll fix 'em, but… what’s canonical way of
deciding that I’m on a Windows box?

It crashes :slight_smile:

Sorry, could not resist - actually I find Win2K fairly stable.

I don’t have a good way to detect Windows - but cmd.exe is in the path of
all Windows NT derived systems and command.exe is on all Windows systems.
There is the WINDIR env. variable. and the OS variable probably begins with
Windows. My Win2K and WinXP says OS=Windows_NT. Env var names should be
tested case-insensitive.

Mikkel

···

On Saturday, Mar 8, 2003, at 17:41 US/Central, Sam Roberts wrote: