lib/rubygems: explicitly clarify the type for =~ matching
RubyGems is very indifferent for type. This change is needed for removal of `Object#=~`. [Feature #15231] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0edc36b9f2
commit
f7e94df0d6
@ -361,7 +361,7 @@ class Gem::Command
|
||||
|
||||
def remove_option(name)
|
||||
@option_groups.each do |_, option_list|
|
||||
option_list.reject! { |args, _| args.any? { |x| x =~ /^#{name}/ } }
|
||||
option_list.reject! { |args, _| args.any? { |x| x.is_a?(String) && x =~ /^#{name}/ } }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -213,7 +213,7 @@ class Gem::Version
|
||||
end
|
||||
|
||||
# If version is an empty string convert it to 0
|
||||
version = 0 if version =~ /\A\s*\Z/
|
||||
version = 0 if version.is_a?(String) && version =~ /\A\s*\Z/
|
||||
|
||||
@version = version.to_s.strip.gsub("-",".pre.")
|
||||
@segments = nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user