summaryrefslogtreecommitdiff
path: root/misc/rubygems/patches/patch-an
blob: 45da647a940c669fa89de0e4ad640a86f46f62b4 (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
$NetBSD: patch-an,v 1.2 2010/09/16 12:02:05 taca Exp $

Add install_root option for pkgsrc's rubygems support.

--- lib/rubygems/commands/unpack_command.rb.orig	2010-04-20 06:46:32.000000000 +0000
+++ lib/rubygems/commands/unpack_command.rb
@@ -12,6 +12,10 @@ class Gem::Commands::UnpackCommand < Gem
           :version => Gem::Requirement.default,
           :target  => Dir.pwd
 
+    add_option('--install-root DIR', 'Root directory for gem files on extract') do |value, options|
+      options[:install_root] = value
+    end
+
     add_option('--target=DIR',
                'target directory for unpacking') do |value, options|
       options[:target] = value
@@ -56,7 +60,8 @@ class Gem::Commands::UnpackCommand < Gem
         basename = File.basename path, '.gem'
         target_dir = File.expand_path basename, options[:target]
         FileUtils.mkdir_p target_dir
-        Gem::Installer.new(path, :unpack => true).unpack target_dir
+        Gem::Installer.new(path, :unpack => true,
+                           :install_root => options[:install_root]).unpack target_dir
         say "Unpacked gem: '#{target_dir}'"
       else
         alert_error "Gem '#{name}' not installed."