1 $NetBSD: patch-ah,v 1.9 2011/08/12 15:50:44 taca Exp $
3 Add install_root option for pkgsrc's rubygems support.
5 --- lib/rubygems.rb.orig 2011-08-27 00:43:50.000000000 +0000
7 @@ -327,7 +327,10 @@ module Gem
9 # The path where gem executables are to be installed.
11 - def self.bindir(install_dir=Gem.dir)
12 + def self.bindir(install_dir=Gem.dir, install_root=nil)
13 + unless install_root.nil?
14 + install_dir = install_dir.sub(install_root, "")
16 # TODO: move to Gem::Dirs
17 return File.join install_dir, 'bin' unless
18 install_dir.to_s == Gem.default_dir.to_s
19 @@ -619,12 +622,12 @@ module Gem
21 # The index to insert activated gem paths into the $LOAD_PATH.
23 - # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
24 + # Defaults to the vendor lib directory unless gem_prelude.rb has loaded paths,
25 # then it inserts the activated gem's paths before the gem_prelude.rb paths
26 # so you can override the gem_prelude.rb default $LOAD_PATH paths.
28 def self.load_path_insert_index
29 - index = $LOAD_PATH.index ConfigMap[:sitelibdir]
30 + index = $LOAD_PATH.index ConfigMap[:vendorlibdir]
32 if QUICKLOADER_SUCKAGE then
33 $LOAD_PATH.each_with_index do |path, i|
34 @@ -799,6 +802,7 @@ module Gem
35 prefix = File.dirname RUBYGEMS_DIR
37 if prefix != File.expand_path(ConfigMap[:sitelibdir]) and
38 + prefix != File.expand_path(ConfigMap[:vendorlibdir]) and
39 prefix != File.expand_path(ConfigMap[:libdir]) and
40 'lib' == File.basename(RUBYGEMS_DIR) then