summaryrefslogtreecommitdiff
path: root/test/rubygems/utilities.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-04-04 12:03:13 +0900
committergit <svn-admin@ruby-lang.org>2023-04-04 12:20:43 +0000
commita881b33818b101ad097cd0158afda11b6c24f1fc (patch)
tree73111721667233a91e214e4df703d91ab19cfded /test/rubygems/utilities.rb
parenta78e0ca968115cbf57228cf2c026d2e21534dc7b (diff)
downloadruby-a881b33818b101ad097cd0158afda11b6c24f1fc.tar.gz
[rubygems/rubygems] util/rubocop -A --only Performance/RegexpMatch
https://github.com/rubygems/rubygems/commit/52ae4452c2
Diffstat (limited to 'test/rubygems/utilities.rb')
-rw-r--r--test/rubygems/utilities.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/rubygems/utilities.rb b/test/rubygems/utilities.rb
index 0f9eef3ec5..2bd28d9a4b 100644
--- a/test/rubygems/utilities.rb
+++ b/test/rubygems/utilities.rb
@@ -120,7 +120,7 @@ class Gem::FakeFetcher
path = path.to_s
@paths << path
- raise ArgumentError, "need full URI" unless path =~ %r{^http://}
+ raise ArgumentError, "need full URI" unless %r{^http://}.match?(path)
unless @data.key? path
raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path)
@@ -141,7 +141,7 @@ class Gem::FakeFetcher
path = File.join path, name
- if source_uri =~ /^http/
+ if /^http/.match?(source_uri)
File.open(path, "wb") do |f|
f.write fetch_path(File.join(source_uri, "gems", name))
end