summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 06:01:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-08 06:01:49 +0000
commit75894547f50888b86f15c118b6e047d8b9a94a74 (patch)
tree09640cd4d0e802d5071f2ed71934c230405d5bf8 /lib
parentee68f78c2462908882e3394f8a91631ec4a45beb (diff)
downloadruby-75894547f50888b86f15c118b6e047d8b9a94a74.tar.gz
* lib/rubygems/commands/cleanup_command.rb: Skip default gems when
cleaning up. * test/rubygems/test_gem_commands_cleanup_command.rb: Test for above. * lib/rubygems/commands/query_command.rb: Fixed listing remote gems. * lib/rubygems/dependency_installer.rb: Ignore non-files when looking for local gems. * test/rubygems/test_gem_dependency_installer.rb: Test for above. * lib/rubygems/uninstaller.rb: The user must confirm uninstalling gems that have dependencies. * test/rubygems/test_gem_uninstaller.rb: Test for above. * lib/rubygems.rb (module Gem): Updated version. * test/rubygems/*.pem: Updated to run in FIPS mode. * test/rubygems/test_gem_security.rb: ditto. * test/rubygems/test_gem_security_signer.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems.rb2
-rw-r--r--lib/rubygems/commands/cleanup_command.rb29
-rw-r--r--lib/rubygems/commands/query_command.rb4
-rw-r--r--lib/rubygems/dependency_installer.rb8
-rw-r--r--lib/rubygems/uninstaller.rb2
5 files changed, 29 insertions, 16 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 89305705af..d39a68ca09 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -98,7 +98,7 @@
require 'rbconfig'
module Gem
- VERSION = '2.0.0.preview2'
+ VERSION = '2.0.0.preview2.1'
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb
index f18a94d7a2..a7071ce679 100644
--- a/lib/rubygems/commands/cleanup_command.rb
+++ b/lib/rubygems/commands/cleanup_command.rb
@@ -47,16 +47,17 @@ are not removed.
end
end
- gems_to_cleanup = unless options[:args].empty? then
- options[:args].map do |gem_name|
- Gem::Specification.find_all_by_name gem_name
- end.flatten
- else
- Gem::Specification.to_a
- end
-
- gems_to_cleanup = gems_to_cleanup.select { |spec|
- primary_gems[spec.name].version != spec.version
+ candidate_gems = unless options[:args].empty? then
+ options[:args].map do |gem_name|
+ Gem::Specification.find_all_by_name gem_name
+ end.flatten
+ else
+ Gem::Specification.to_a
+ end
+
+ gems_to_cleanup = candidate_gems.select { |spec|
+ !spec.default_gem? and
+ primary_gems[spec.name].version != spec.version
}
full = Gem::DependencyList.from_specs
@@ -102,6 +103,14 @@ are not removed.
end
say "Clean Up Complete"
+
+ if Gem.configuration.really_verbose then
+ skipped = candidate_gems.
+ select { |spec| spec.default_gem? }.
+ map { |spec| spec.full_name}
+
+ say "Skipped default gems: #{skipped.join ', '}"
+ end
end
end
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index b6c910d449..020bc297b4 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -132,8 +132,8 @@ class Gem::Commands::QueryCommand < Gem::Command
if options[:name].source.empty?
spec_tuples = fetcher.detect(type) { true }
else
- spec_tuples = fetcher.detect(type) do |gem_name, ver, plat|
- options[:name] === gem_name
+ spec_tuples = fetcher.detect(type) do |name_tuple|
+ options[:name] === name_tuple.name
end
end
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index a2665633fc..ed90af042c 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -33,6 +33,7 @@ class Gem::DependencyInstaller
:prerelease => false,
:security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
:wrappers => true,
+ :build_args => nil,
:build_docs_in_background => false,
}.freeze
@@ -53,6 +54,7 @@ class Gem::DependencyInstaller
# :security_policy:: See Gem::Installer::new and Gem::Security.
# :user_install:: See Gem::Installer.new
# :wrappers:: See Gem::Installer::new
+ # :build_args:: See Gem::Installer::new
def initialize(options = {})
if options[:install_dir] then
@@ -79,6 +81,7 @@ class Gem::DependencyInstaller
@security_policy = options[:security_policy]
@user_install = options[:user_install]
@wrappers = options[:wrappers]
+ @build_args = options[:build_args]
@build_docs_in_background = options[:build_docs_in_background]
# Indicates that we should not try to update any deps unless
@@ -257,7 +260,7 @@ class Gem::DependencyInstaller
set = Gem::AvailableSet.new
if consider_local?
- if File.exists? gem_name
+ if File.file? gem_name then
src = Gem::Source::SpecificFile.new(gem_name)
set.add src.spec, src
else
@@ -353,7 +356,8 @@ class Gem::DependencyInstaller
:install_dir => @install_dir,
:security_policy => @security_policy,
:user_install => @user_install,
- :wrappers => @wrappers
+ :wrappers => @wrappers,
+ :build_args => @build_args
spec = inst.install
diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
index 77b312177d..475211dfe3 100644
--- a/lib/rubygems/uninstaller.rb
+++ b/lib/rubygems/uninstaller.rb
@@ -296,7 +296,7 @@ class Gem::Uninstaller
msg << 'If you remove this gem, these dependencies will not be met.'
msg << 'Continue with Uninstall?'
- return ask_yes_no(msg.join("\n"), true)
+ return ask_yes_no(msg.join("\n"), false)
end
def formatted_program_filename(filename)