From: Richard Lionheart Date: 2004-05-28T22:14:02+09:00 Subject: Re: require "fox/responder" does the job ... thanks Hi Lyle, Thanks for these add'l details. There were so many responses on this thread that I missed this particular post until I checked back today. Again, thanks for all your insights. Regards, Richard "Lyle Johnson" wrote in message news:40AD6930.1060208@knology.net... > Richard Lionheart wrote: > > > As I understand your advice, which I've tried and it works (as you > > expected), is to drop \fox from the first and prefix fox/ in the latter. > > (BTW, prefixing fox\ does NOT work, despite the fact I running Win2000Pro > > ... it looks like the conversion from \ to / happens when the environment is > > first accessed.) > > Yes, I would guess that if you do something like: > > require 'fox\responder' > > that Ruby is interpreting the '\' character as an escape code or > something. I just always use the '/' character as the path separator for > require() and it works fine. > > > It seems to me that the rationale underlying your approach is that I can > > equally well reference other packages parallel to the fox folder without > > changing RUBYLIB each time. > > Yes, sure. This is a pretty standard approach for most Ruby libraries. > > > I'd like to check one other issue: in your judgement, what's the purpose > > of the initial 'require "fox"' statement. Hal speculated it references the > > fox.so library (interesting, a Unix extension in a Windows environment) and > > that the interpreter has a built-in path to it (its located in > > Ruby\lib\ruby\site_ruby\1.8\i386-msvcrt). > > Sorry I didn't address that question in my previous response. Yes, Hal > was correct that the 'require "fox"' line loads in the main extension > file, fox.so. Most of the code that makes up the FXRuby extension is > compiled C++ code and lives in this file. Some of the supporting code > (e.g. responder.rb), which is written in Ruby, lives in the "fox" > subfolder. And despite its extension (.so), fox.so is just your basic > DLL on Windows. And yes, the path to it is built-in to the interpreter; > you should be able to check to see what the default RUBYLIB is by typing: > > ruby -e 'puts $:' > > For example, on my Apple PowerBook (from which I'm sending this message) > the above command prints: > > /sw/lib/ruby/site_ruby/1.8 > /sw/lib/ruby/site_ruby/1.8/powerpc-darwin > /sw/lib/ruby/site_ruby > /sw/lib/ruby/1.8 > /sw/lib/ruby/1.8/powerpc-darwin > . > > where "powerpc-darwin" is the OS, just like "i386-msvcrt" is on your PC. > > Hope this helps, > > Lyle > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.690 / Virus Database: 451 - Release Date: 5/23/2004