blob: 43205b9a63ecd6af9d4ce6654c09bacc3c363a26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
$NetBSD: patch-ah,v 1.5 2009/06/10 21:44:31 minskim Exp $
--- lib/rubygems.rb.orig 2009-05-21 14:44:06.000000000 -0700
+++ lib/rubygems.rb
@@ -396,7 +396,13 @@ module Gem
##
# The path where gem executables are to be installed.
- def self.bindir(install_dir=Gem.dir)
+ def self.bindir(install_dir=Gem.dir, install_root=nil)
+ unless install_root.nil?
+ install_root_path = Pathname.new install_root
+ install_dir_path = Pathname.new install_dir
+ install_dir_path = install_dir_path.relative_path_from install_root_path
+ install_dir = install_dir_path.expand_path File::SEPARATOR
+ end
return File.join(install_dir, 'bin') unless
install_dir.to_s == Gem.default_dir
Gem.default_bindir
@@ -637,12 +643,12 @@ module Gem
##
# The index to insert activated gem paths into the $LOAD_PATH.
#
- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
+ # Defaults to the vendor lib directory unless gem_prelude.rb has loaded paths,
# then it inserts the activated gem's paths before the gem_prelude.rb paths
# so you can override the gem_prelude.rb default $LOAD_PATH paths.
def self.load_path_insert_index
- index = $LOAD_PATH.index ConfigMap[:sitelibdir]
+ index = $LOAD_PATH.index ConfigMap[:vendorlibdir]
$LOAD_PATH.each_with_index do |path, i|
if path.instance_variables.include?(:@gem_prelude_index) or
@@ -750,7 +756,8 @@ module Gem
def self.prefix
prefix = File.dirname File.expand_path(__FILE__)
- if File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
+ if File.dirname(prefix) == File.expand_path(ConfigMap[:vendorlibdir]) or
+ File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
'lib' != File.basename(prefix) then
nil
|