diff options
author | Hiroshi SHIBATA <[email protected]> | 2022-08-09 11:16:07 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-08-09 12:05:19 +0900 |
commit | 44264b4fee1e208e759710c39271186ff9856b40 (patch) | |
tree | 939a9810293c86553e7b600bce9fb426776f6000 /lib/rubygems/query_utils.rb | |
parent | f8936b3341376948112e31f9e9b0cb3ad6e91e7c (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/query_utils.rb')
-rw-r--r-- | lib/rubygems/query_utils.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rubygems/query_utils.rb b/lib/rubygems/query_utils.rb index 4601d9374c..a502717f94 100644 --- a/lib/rubygems/query_utils.rb +++ b/lib/rubygems/query_utils.rb @@ -112,7 +112,7 @@ module Gem::QueryUtils end def display_header(type) - if (ui.outs.tty? and Gem.configuration.verbose) or both? + if (ui.outs.tty? && Gem.configuration.verbose) || both? say say "*** #{type} GEMS ***" say @@ -132,7 +132,7 @@ module Gem::QueryUtils name_matches = name ? s.name =~ name : true version_matches = show_prereleases? || !s.version.prerelease? - name_matches and version_matches + name_matches && version_matches end spec_tuples = specs.map do |spec| @@ -176,7 +176,7 @@ module Gem::QueryUtils # Check if gem +name+ version +version+ is installed. def installed?(name, req = Gem::Requirement.default) - Gem::Specification.any? {|s| s.name =~ name and req =~ s.version } + Gem::Specification.any? {|s| s.name =~ name && req =~ s.version } end def output_query_results(spec_tuples) @@ -242,7 +242,7 @@ module Gem::QueryUtils return unless options[:versions] list = - if platforms.empty? or options[:details] + if platforms.empty? || options[:details] name_tuples.map {|n| n.version }.uniq else platforms.sort.reverse.map do |version, pls| @@ -289,13 +289,13 @@ module Gem::QueryUtils end def spec_homepage(entry, spec) - return if spec.homepage.nil? or spec.homepage.empty? + return if spec.homepage.nil? || spec.homepage.empty? entry << "\n" << format_text("Homepage: #{spec.homepage}", 68, 4) end def spec_license(entry, spec) - return if spec.license.nil? or spec.license.empty? + return if spec.license.nil? || spec.license.empty? licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: ".dup licenses << spec.licenses.join(", ") |