aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-07 00:53:01 +0000
commit97f80207d0f0d13f28a419d8c92e96bb9064096a (patch)
treede416fff9bbc978434cb4c1185099151df2ac27c /lib/rubygems/commands
parenta0b80a44101708b5d66cdd87f16c98277954a77c (diff)
downloadruby-97f80207d0f0d13f28a419d8c92e96bb9064096a.tar.gz
* lib/rubygems: Update to RubyGems 2.4.5.
* test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/pristine_command.rb16
-rw-r--r--lib/rubygems/commands/uninstall_command.rb2
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb
index b54e7eac93..dcd5bb76fb 100644
--- a/lib/rubygems/commands/pristine_command.rb
+++ b/lib/rubygems/commands/pristine_command.rb
@@ -109,6 +109,11 @@ extensions will be restored.
next
end
+ if spec.bundled_gem_in_old_ruby?
+ say "Skipped #{spec.full_name}, it is bundled with old Ruby"
+ next
+ end
+
unless spec.extensions.empty? or options[:extensions] then
say "Skipped #{spec.full_name}, it needs to compile an extension"
next
@@ -120,8 +125,17 @@ extensions will be restored.
require 'rubygems/remote_fetcher'
say "Cached gem for #{spec.full_name} not found, attempting to fetch..."
+
dep = Gem::Dependency.new spec.name, spec.version
- Gem::RemoteFetcher.fetcher.download_to_cache dep
+ found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep
+
+ if found.empty?
+ say "Skipped #{spec.full_name}, it was not found from cache and remote sources"
+ next
+ end
+
+ spec_candidate, source = found.first
+ Gem::RemoteFetcher.fetcher.download spec_candidate, source.uri.to_s, spec.base_dir
end
env_shebang =
diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb
index 71ffdc89fc..9285e57b77 100644
--- a/lib/rubygems/commands/uninstall_command.rb
+++ b/lib/rubygems/commands/uninstall_command.rb
@@ -124,7 +124,7 @@ that is a dependency of an existing gem. You can use the
end
def uninstall_all
- _, specs = Gem::Specification.partition { |spec| spec.default_gem? }
+ specs = Gem::Specification.reject { |spec| spec.default_gem? }
specs.each do |spec|
options[:version] = spec.version