aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
commit4f6779bac7b4e294bc473782d60cbd071f0d0f8d (patch)
treed37b54da20f8c0adf2d98e810aacc8259b0602ff /lib/rubygems/commands
parent31d355aaa9436e2b24efd5e6501cabd876267c46 (diff)
downloadruby-4f6779bac7b4e294bc473782d60cbd071f0d0f8d.tar.gz
* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
in this commit: RubyGems now chooses the test server port reliably. Patch by akr. Partial implementation of bundler's Gemfile format. Refactorings to improve the new resolver. Fixes bugs in the resolver. * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r--lib/rubygems/commands/install_command.rb19
-rw-r--r--lib/rubygems/commands/update_command.rb2
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 1f3210ff5d..ad90b37fdc 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -22,6 +22,7 @@ class Gem::Commands::InstallCommand < Gem::Command
defaults = Gem::DependencyInstaller::DEFAULT_OPTIONS.merge({
:format_executable => false,
:version => Gem::Requirement.default,
+ :without_groups => [],
})
super 'install', 'Install a gem into the local repository', defaults
@@ -42,6 +43,13 @@ class Gem::Commands::InstallCommand < Gem::Command
o[:gemdeps] = v
end
+ add_option(:"Install/Update", '--without GROUPS', Array,
+ 'Omit the named groups (comma separated)',
+ 'when installing from a gem dependencies',
+ 'file') do |v,o|
+ o[:without_groups].concat v.map { |without| without.intern }
+ end
+
add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o|
@@ -133,8 +141,8 @@ to write the specification by hand. For example:
end
def execute
- if gf = options[:gemdeps] then
- install_from_gemdeps gf
+ if options.include? :gemdeps then
+ install_from_gemdeps
return # not reached
end
@@ -154,14 +162,11 @@ to write the specification by hand. For example:
terminate_interaction exit_code
end
- def install_from_gemdeps gf # :nodoc:
+ def install_from_gemdeps # :nodoc:
require 'rubygems/request_set'
rs = Gem::RequestSet.new
- rs.load_gemdeps gf
-
- rs.resolve
- specs = rs.install options do |req, inst|
+ specs = rs.install_from_gemdeps options do |req, inst|
s = req.full_spec
if inst
diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb
index c3532841c3..b4ee59b3bb 100644
--- a/lib/rubygems/commands/update_command.rb
+++ b/lib/rubygems/commands/update_command.rb
@@ -112,7 +112,7 @@ command to remove old versions.
spec_tuples, errors = fetcher.search_for_dependency dependency
- error = errors.find { |errors| errors.respond_to? :exception }
+ error = errors.find { |e| e.respond_to? :exception }
raise error if error