diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-04-04 12:03:13 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-04-04 12:20:43 +0000 |
commit | a881b33818b101ad097cd0158afda11b6c24f1fc (patch) | |
tree | 73111721667233a91e214e4df703d91ab19cfded /lib/rubygems/specification_policy.rb | |
parent | a78e0ca968115cbf57228cf2c026d2e21534dc7b (diff) |
[rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
Diffstat (limited to 'lib/rubygems/specification_policy.rb')
-rw-r--r-- | lib/rubygems/specification_policy.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb index a5e7499531..19537a873d 100644 --- a/lib/rubygems/specification_policy.rb +++ b/lib/rubygems/specification_policy.rb @@ -144,7 +144,7 @@ class Gem::SpecificationPolicy end next unless METADATA_LINK_KEYS.include? key - if value !~ VALID_URI_PATTERN + if !VALID_URI_PATTERN.match?(value) error "#{entry} has invalid link: #{value.inspect}" end end @@ -279,11 +279,11 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use: if !name.is_a?(String) error "invalid value for attribute name: \"#{name.inspect}\" must be a string" - elsif name !~ /[a-zA-Z]/ + elsif !/[a-zA-Z]/.match?(name) error "invalid value for attribute name: #{name.dump} must include at least one letter" - elsif name !~ VALID_NAME_PATTERN + elsif !VALID_NAME_PATTERN.match?(name) error "invalid value for attribute name: #{name.dump} can only include letters, numbers, dashes, and underscores" - elsif name =~ SPECIAL_CHARACTERS + elsif SPECIAL_CHARACTERS.match?(name) error "invalid value for attribute name: #{name.dump} can not begin with a period, dash, or underscore" end end @@ -397,11 +397,11 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li error "#{LAZY} is not an email" end - if @specification.description =~ LAZY_PATTERN + if LAZY_PATTERN.match?(@specification.description) error "#{LAZY} is not a description" end - if @specification.summary =~ LAZY_PATTERN + if LAZY_PATTERN.match?(@specification.summary) error "#{LAZY} is not a summary" end |