aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/install_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/install_command.rb')
-rw-r--r--lib/rubygems/commands/install_command.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 06a89eeb0a..530f746e89 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -1,3 +1,9 @@
+######################################################################
+# This file is imported from the rubygems project.
+# DO NOT make modifications in this repo. They _will_ be reverted!
+# File a patch instead and assign it to Ryan Davis or Eric Hodel.
+######################################################################
+
require 'rubygems/command'
require 'rubygems/doc_manager'
require 'rubygems/install_update_options'
@@ -22,7 +28,6 @@ class Gem::Commands::InstallCommand < Gem::Command
:generate_rdoc => true,
:generate_ri => true,
:format_executable => false,
- :test => false,
:version => Gem::Requirement.default,
})
@@ -41,7 +46,7 @@ class Gem::Commands::InstallCommand < Gem::Command
def defaults_str # :nodoc:
"--both --version '#{Gem::Requirement.default}' --rdoc --ri --no-force\n" \
- "--no-test --install-dir #{Gem.dir}"
+ "--install-dir #{Gem.dir}"
end
def description # :nodoc:
@@ -115,6 +120,8 @@ to write the specification by hand. For example:
get_all_gem_names.each do |gem_name|
begin
+ next if options[:conservative] && Gem.available?(gem_name, options[:version])
+
inst = Gem::DependencyInstaller.new options
inst.install gem_name, options[:version]
@@ -127,7 +134,7 @@ to write the specification by hand. For example:
alert_error "Error installing #{gem_name}:\n\t#{e.message}"
exit_code |= 1
rescue Gem::GemNotFoundException => e
- show_lookup_failure e.name, e.version, e.errors
+ show_lookup_failure e.name, e.version, e.errors, options[:domain]
exit_code |= 2
end
@@ -154,19 +161,6 @@ to write the specification by hand. For example:
Gem::DocManager.new(gem, options[:rdoc_args]).generate_rdoc
end
end
-
- if options[:test] then
- installed_gems.each do |spec|
- gem_spec = Gem::SourceIndex.from_installed_gems.find_name(spec.name, spec.version.version).first
- result = Gem::Validator.new.unit_test(gem_spec)
- if result and not result.passed?
- unless ask_yes_no("...keep Gem?", true)
- require 'rubygems/uninstaller'
- Gem::Uninstaller.new(spec.name, :version => spec.version.version).uninstall
- end
- end
- end
- end
end
raise Gem::SystemExitException, exit_code