James Gray
8/24/2006 5:51:00 PM
On Aug 24, 2006, at 11:54 AM, Henry Savr wrote:
> I want to manage the way how Ruby searches modules to load. I found,
> that the $: variable is in charge, but it is read-only.
Na, you can change it:
>> $: << "search_here_last
"
=> ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/
site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/site_ruby", "/
usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-darwin8.5.2",
".", "search_here_last\n"]
>> exit
Firefly:~$ irb
>> $: << "search_here_last"
=> ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/
site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/site_ruby", "/
usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-darwin8.5.2",
".", "search_here_last"]
>> $:.unshift("search_here_first")
=> ["search_here_first", "/usr/local/lib/ruby/site_ruby/1.8", "/usr/
local/lib/ruby/site_ruby/1.8/i686-darwin8.5.2", "/usr/local/lib/ruby/
site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/i686-
darwin8.5.2", ".", "search_here_last"]
James Edward Gray II