aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-01 03:11:34 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-01 03:11:34 +0000
commitec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513 (patch)
treecc3b9df7f06f86c52f4d09c03f5c9a3876c87b67 /lib/rubygems/commands
parentf4234c9b8f4707c5979d9a3beddc19ceeb417bd8 (diff)
downloadruby-ec84bfc9e3d11a3b1dbebcaf4d1ddf1357307513.tar.gz
Import rubygems 1.5.0 (released version @ 1fb59d0)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/setup_command.rb6
-rw-r--r--lib/rubygems/commands/unpack_command.rb26
2 files changed, 23 insertions, 9 deletions
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index b7fb62cf53..f40733a3ed 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -342,8 +342,10 @@ abort "#{deprecation_message}"
require 'rdoc/rdoc'
args << '--quiet'
- args << '--main' << 'README'
- args << '.' << 'README' << 'LICENSE.txt' << 'GPL.txt'
+ args << '--main' << 'README.rdoc'
+ args << '.'
+ args << 'README.rdoc' << 'UPGRADING.rdoc'
+ args << 'LICENSE.txt' << 'GPL.txt' << 'History.txt'
r = RDoc::RDoc.new
r.document args
diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb
index 5e0bc830f2..ac1d376106 100644
--- a/lib/rubygems/commands/unpack_command.rb
+++ b/lib/rubygems/commands/unpack_command.rb
@@ -72,6 +72,22 @@ class Gem::Commands::UnpackCommand < Gem::Command
end
##
+ #
+ # Find cached filename in Gem.path. Returns nil if the file cannot be found.
+ #
+ #--
+ # TODO: see comments in get_path() about general service.
+
+ def find_in_cache(filename)
+ Gem.path.each do |gem_dir|
+ this_path = File.join gem_dir, 'cache', filename
+ return this_path if File.exist? this_path
+ end
+
+ return nil
+ end
+
+ ##
# Return the full path to the cached gem file matching the given
# name and version requirement. Returns 'nil' if no match.
#
@@ -101,13 +117,9 @@ class Gem::Commands::UnpackCommand < Gem::Command
# We expect to find (basename).gem in the 'cache' directory. Furthermore,
# the name match must be exact (ignoring case).
- filename = selected.file_name
- path = nil
-
- Gem.path.find do |gem_dir|
- path = File.join gem_dir, 'cache', filename
- File.exist? path
- end
+
+ path = find_in_cache(selected.file_name)
+ return download(dependency) unless path
path
end