aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/command.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/command.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
downloadruby-5335ce0e060c7a2a0b01c57f8f8a64254f2658e1.tar.gz
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/command.rb')
-rw-r--r--lib/rubygems/command.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb
index 3fc8a70a3e..9f22cb9e82 100644
--- a/lib/rubygems/command.rb
+++ b/lib/rubygems/command.rb
@@ -160,7 +160,7 @@ class Gem::Command
msg << ", here is why:\n"
errors.each { |x| msg << " #{x.wordy}\n" }
else
- if required_by and gem != required_by then
+ if required_by and gem != required_by
msg << " (required by #{required_by}) in any repository"
else
msg << " in any repository"
@@ -169,7 +169,7 @@ class Gem::Command
alert_error msg
- unless domain == :local then # HACK
+ unless domain == :local # HACK
suggestions = Gem::SpecFetcher.fetcher.suggest_gems_from_name gem_name
unless suggestions.empty?
@@ -184,7 +184,7 @@ class Gem::Command
def get_all_gem_names
args = options[:args]
- if args.nil? or args.empty? then
+ if args.nil? or args.empty?
raise Gem::CommandLineError,
"Please specify at least one gem name (e.g. gem build GEMNAME)"
end
@@ -214,12 +214,12 @@ class Gem::Command
def get_one_gem_name
args = options[:args]
- if args.nil? or args.empty? then
+ if args.nil? or args.empty?
raise Gem::CommandLineError,
"Please specify a gem name on the command line (e.g. gem build GEMNAME)"
end
- if args.size > 1 then
+ if args.size > 1
raise Gem::CommandLineError,
"Too many gem names (#{args.join(', ')}); please specify only one"
end
@@ -313,9 +313,9 @@ class Gem::Command
self.ui = ui = Gem::SilentUI.new
end
- if options[:help] then
+ if options[:help]
show_help
- elsif @when_invoked then
+ elsif @when_invoked
@when_invoked.call options
else
execute
@@ -451,7 +451,7 @@ class Gem::Command
# Adds a section with +title+ and +content+ to the parser help view. Used
# for adding command arguments and default arguments.
- def add_parser_run_info title, content
+ def add_parser_run_info(title, content)
return if content.empty?
@parser.separator nil
@@ -531,7 +531,7 @@ class Gem::Command
add_common_option('-V', '--[no-]verbose',
'Set the verbose level of output') do |value, options|
# Set us to "really verbose" so the progress meter works
- if Gem.configuration.verbose and value then
+ if Gem.configuration.verbose and value
Gem.configuration.verbose = 1
else
Gem.configuration.verbose = value