2008-05-28 13:10:50 +04:00
|
|
|
nul = nil
|
|
|
|
$:.each_with_index {|path, index|
|
|
|
|
if /\A(?:\.\/)*-\z/ =~ path
|
|
|
|
nul = index
|
|
|
|
break
|
|
|
|
end
|
|
|
|
}
|
|
|
|
if nul
|
2010-02-05 19:21:56 +03:00
|
|
|
removed, $:[nul..-1] = $:[nul..-1], []
|
2009-07-15 13:05:32 +04:00
|
|
|
if defined?(Gem::QuickLoader)
|
|
|
|
removed.each do |path|
|
|
|
|
# replaces a fake rubygems by gem_prelude.rb with an alternative path
|
|
|
|
index = $".index(File.join(path, 'rubygems.rb'))
|
|
|
|
$"[index] = Gem::QuickLoader.path_to_full_rubygems_library if index
|
|
|
|
end
|
|
|
|
end
|
2007-05-23 00:48:34 +04:00
|
|
|
end
|