[rubygems/rubygems] Simplify argument processing logic in gem list
& gem search
Make it more explicit that if not specific arguments are given, the value of `-n` is used. https://github.com/rubygems/rubygems/commit/ed811ddc00
This commit is contained in:
parent
e4f8d5b2f5
commit
8b6a02de2f
@ -58,10 +58,10 @@ module Gem::QueryUtils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def execute
|
def execute
|
||||||
gem_names = Array(options[:name])
|
gem_names = if args.empty?
|
||||||
|
Array(options[:name])
|
||||||
if !args.empty?
|
else
|
||||||
gem_names = options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i }
|
options[:exact] ? args.map{|arg| /\A#{Regexp.escape(arg)}\Z/ } : args.map{|arg| /#{arg}/i }
|
||||||
end
|
end
|
||||||
|
|
||||||
terminate_interaction(check_installed_gems(gem_names)) if check_installed_gems?
|
terminate_interaction(check_installed_gems(gem_names)) if check_installed_gems?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user