pkgsrc/lang/ruby193-base/patches/patch-lib_rubygems.rb
taca 1f8b87297f Importing ruby193-base version 1.9.3p0 (Ruby 1.9.3 p0):
Please refer detail for:
	http://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/NEWS
	http://svn.ruby-lang.org/repos/ruby/tags/v1_9_3_0/ChangeLog

Short summary from NEWS:

* Ruby's License is changed from a dual license with GPLv2
  to a dual license with 2-clause BSDL.

* Encoding
  * new encodings: CP950, CP951, UTF-16 and UTF-32
  * change alias:
    * SJIS is Windows-31J

* Regexps now support Unicode 6.0. (new characters and scripts)

* builtin classes

  * ARGF
    * new methods: ARGF.read_nonblock and so on.
  * Array
    * extended method: Array#pack supports endian modifiers
  * String
    * extended method: String#unpack supports endian modifiers
    * new method: String#prepend and String#byteslice
  * Bignum
    * Multiplication algorithm for Bignums with a large number of digits over
      150 BDIGITs is changed in order to reduce its calculation time.
      Now such large Bignums are multiplied by using Toom-3 algorithm.
  * File
    * new constant: File::NULL and File::DIRECT
  * IO
    * extended method: IO#putc supports multibyte characters
    * new methods: * IO#advise, IO.write and IO.binwrite
  * Kernel
    * move #__id__ to BasicObject
    * extended method: Kernel#rand supports range argument
  * Module
    * new methods: Module#private_constant and Module#public_constant
  * Random
    * extended method: Random.rand supports range argument
  * Time
    * extended method: Time#strftime supports %:z and %::z
  * Process
    * Process#maxgroups and Process#maxgroups= now raise NotImplementedError if
      the platform don't support supplementary groups concept
2011-11-08 16:10:51 +00:00

41 lines
1.6 KiB
Ruby

$NetBSD: patch-lib_rubygems.rb,v 1.1.1.1 2011/11/08 16:10:51 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems.rb.orig 2011-08-26 01:12:57.000000000 +0000
+++ lib/rubygems.rb
@@ -327,7 +327,10 @@ 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_dir = install_dir.sub(install_root, "")
+ end
# TODO: move to Gem::Dirs
return File.join install_dir, 'bin' unless
install_dir.to_s == Gem.default_dir.to_s
@@ -619,12 +622,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]
if QUICKLOADER_SUCKAGE then
$LOAD_PATH.each_with_index do |path, i|
@@ -799,6 +802,7 @@ module Gem
prefix = File.dirname RUBYGEMS_DIR
if prefix != File.expand_path(ConfigMap[:sitelibdir]) and
+ prefix != File.expand_path(ConfigMap[:vendorlibdir]) and
prefix != File.expand_path(ConfigMap[:libdir]) and
'lib' == File.basename(RUBYGEMS_DIR) then
prefix