I currently use RUBYLIB in a similar way.  It's especially handy for 
one-off command-line scripts:

.bashrc -
export RUBYLIB=c:/cvs-main/db-building/scripts

...

ruby -e "require 'lsml'; $p.parse{ |r| r.ids.each {|id| if id.type == 
'reg' then puts id end}}" file.xml

where the lsml library has a bunch of pre-canned tools set up.  It would 
be a drag to have to specify -I ... every time.

The problem I ran into with jruby is that it doesn't know about the 
cygwin mounts (/cygdrive/c/) and splits on ":" instead of ";" - which 
makes the c:/ notation problematic.  (Incidentally, the cygwin ruby 
handles both ; and : in RUBYLIB)

I posted a fix to jira - where it uses File.pathSeparator instead of :, 
and have been happy ever since.

http://jira.codehaus.org/browse/JRUBY-938


Ola - I'm left curious as to what RUBYLIB is supposed to do, if not 
handle this case, and if so, is there another (perhaps more appropriate) 
way to do what I'm suggesting?

Thanks,
Scott

Ronald Fischer wrote:
>> Ok, what you should do here is not use RUBYLIB at all. JRuby does 
>> understand RUBYLIB, but it won't do what you expect. Instead, 
>> use the -I 
>> parameter to JRuby:
>> 
>> jruby -I lib MYPROGRAM.rb
>> 
>> This will work just fine on both Win32 and Cygwin.
> 
> Thank you very much.
> 
> Ronald


-- 
Posted via http://www.ruby-forum.com/.