diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-04-04 12:03:13 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-04-04 12:20:43 +0000 |
commit | a881b33818b101ad097cd0158afda11b6c24f1fc (patch) | |
tree | 73111721667233a91e214e4df703d91ab19cfded /lib/rubygems/installer.rb | |
parent | a78e0ca968115cbf57228cf2c026d2e21534dc7b (diff) | |
download | ruby-a881b33818b101ad097cd0158afda11b6c24f1fc.tar.gz |
[rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
Diffstat (limited to 'lib/rubygems/installer.rb')
-rw-r--r-- | lib/rubygems/installer.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index fdb2944272..b73f3a493b 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -230,7 +230,7 @@ class Gem::Installer end end - next unless line =~ shebang + next unless line&.match?(shebang) io.gets # blankline @@ -714,7 +714,7 @@ class Gem::Installer end def verify_spec - unless spec.name =~ Gem::Specification::VALID_NAME_PATTERN + unless Gem::Specification::VALID_NAME_PATTERN.match?(spec.name) raise Gem::InstallError, "#{spec} has an invalid name" end @@ -726,11 +726,11 @@ class Gem::Installer raise Gem::InstallError, "#{spec} has an invalid extensions" end - if spec.platform.to_s =~ /\R/ + if /\R/.match?(spec.platform.to_s) raise Gem::InstallError, "#{spec.platform} is an invalid platform" end - unless spec.specification_version.to_s =~ /\A\d+\z/ + unless /\A\d+\z/.match?(spec.specification_version.to_s) raise Gem::InstallError, "#{spec} has an invalid specification_version" end |