summaryrefslogtreecommitdiff
path: root/lib/rubygems/command.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-08-09 11:16:07 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-08-09 12:05:19 +0900
commit44264b4fee1e208e759710c39271186ff9856b40 (patch)
tree939a9810293c86553e7b600bce9fb426776f6000 /lib/rubygems/command.rb
parentf8936b3341376948112e31f9e9b0cb3ad6e91e7c (diff)
Merge rubygems/bundler HEAD.
Pick from https://github.com/rubygems/rubygems/commit/dfbb5a38114640e0d8d616861607f3de73ee0199
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6224
Diffstat (limited to 'lib/rubygems/command.rb')
-rw-r--r--lib/rubygems/command.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb
index 9fc3360fa1..badc21023a 100644
--- a/lib/rubygems/command.rb
+++ b/lib/rubygems/command.rb
@@ -159,11 +159,11 @@ class Gem::Command
gem = "'#{gem_name}' (#{version})"
msg = String.new "Could not find a valid gem #{gem}"
- if errors and !errors.empty?
+ if errors && !errors.empty?
msg << ", here is why:\n"
errors.each {|x| msg << " #{x.wordy}\n" }
else
- if required_by and gem != required_by
+ if required_by && gem != required_by
msg << " (required by #{required_by}) in any repository"
else
msg << " in any repository"
@@ -186,7 +186,7 @@ class Gem::Command
def get_all_gem_names
args = options[:args]
- if args.nil? or args.empty?
+ if args.nil? || args.empty?
raise Gem::CommandLineError,
"Please specify at least one gem name (e.g. gem build GEMNAME)"
end
@@ -216,7 +216,7 @@ class Gem::Command
def get_one_gem_name
args = options[:args]
- if args.nil? or args.empty?
+ if args.nil? || args.empty?
raise Gem::CommandLineError,
"Please specify a gem name on the command line (e.g. gem build GEMNAME)"
end
@@ -554,7 +554,7 @@ class Gem::Command
end
def configure_options(header, option_list)
- return if option_list.nil? or option_list.empty?
+ return if option_list.nil? || option_list.empty?
header = header.to_s.empty? ? "" : "#{header} "
@parser.separator " #{header}Options:"
@@ -586,7 +586,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
+ if Gem.configuration.verbose && value
Gem.configuration.verbose = 1
else
Gem.configuration.verbose = value