summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 1fea6fdcb5..eb9362a500 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -418,8 +418,19 @@ module Bundler
commands["gem"].tap do |gem_command|
def gem_command.run(instance, args = [])
+ arity = 1 # name
+
require "bundler/cli/gem"
- Gem.new(instance.options, *args, instance).run
+ cmd_args = args + [instance]
+ cmd_args.unshift(instance.options)
+
+ cmd = begin
+ Gem.new(*cmd_args)
+ rescue ArgumentError => e
+ instance.class.handle_argument_error(self, e, args, arity)
+ end
+
+ cmd.run
end
end