1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Update to RubyGems 1.3.4 r2223

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2009-06-09 21:38:59 +00:00
parent a6afbaeb3b
commit 31c94ffeb5
126 changed files with 7610 additions and 3747 deletions

View file

@ -12,7 +12,7 @@ class Gem::Commands::UnpackCommand < Gem::Command
:version => Gem::Requirement.default,
:target => Dir.pwd
add_option('--target', 'target directory for unpacking') do |value, options|
add_option('--target=DIR', 'target directory for unpacking') do |value, options|
options[:target] = value
end
@ -35,18 +35,20 @@ class Gem::Commands::UnpackCommand < Gem::Command
# TODO: allow, e.g., 'gem unpack rake-0.3.1'. Find a general solution for
# this, so that it works for uninstall as well. (And check other commands
# at the same time.)
def execute
gemname = get_one_gem_name
path = get_path(gemname, options[:version])
if path then
basename = File.basename(path).sub(/\.gem$/, '')
target_dir = File.expand_path File.join(options[:target], basename)
FileUtils.mkdir_p target_dir
Gem::Installer.new(path, :unpack => true).unpack target_dir
say "Unpacked gem: '#{target_dir}'"
else
alert_error "Gem '#{gemname}' not installed."
def execute
get_all_gem_names.each do |name|
path = get_path name, options[:version]
if path then
basename = File.basename(path).sub(/\.gem$/, '')
target_dir = File.expand_path File.join(options[:target], basename)
FileUtils.mkdir_p target_dir
Gem::Installer.new(path, :unpack => true).unpack target_dir
say "Unpacked gem: '#{target_dir}'"
else
alert_error "Gem '#{name}' not installed."
end
end
end