diff options
-rw-r--r-- | lib/rubygems/commands/query_command.rb | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -1,4 +1,4 @@ -# frozen_string_literal: false require 'rubygems/command' require 'rubygems/local_remote_options' require 'rubygems/spec_fetcher' @@ -50,6 +50,12 @@ class Gem::Commands::QueryCommand < Gem::Command options[:all] = value end add_option( '--[no-]prerelease', 'Display prerelease versions') do |value, options| options[:prerelease] = value @@ -79,7 +85,8 @@ is too hard to use. elsif !options[:name].source.empty? name = Array(options[:name]) else - name = options[:args].to_a.map{|arg| /#{arg}/i } end prerelease = options[:prerelease] @@ -162,7 +169,7 @@ is too hard to use. :latest end - if name.source.empty? spec_tuples = fetcher.detect(type) { true } else spec_tuples = fetcher.detect(type) do |name_tuple| @@ -277,7 +284,7 @@ is too hard to use. end def spec_authors entry, spec - authors = "Author#{spec.authors.length > 1 ? 's' : ''}: " authors << spec.authors.join(', ') entry << format_text(authors, 68, 4) end @@ -291,7 +298,7 @@ is too hard to use. def spec_license entry, spec return if spec.license.nil? or spec.license.empty? - licenses = "License#{spec.licenses.length > 1 ? 's' : ''}: " licenses << spec.licenses.join(', ') entry << "\n" << format_text(licenses, 68, 4) end @@ -341,4 +348,3 @@ is too hard to use. end end - |