rubygem-shoulda-context/rubygem-shoulda-context-2.0.0-Use-File-exist.patch

30 lines
1.0 KiB
Diff
Raw Normal View History

2023-08-02 11:02:02 +08:00
From 83370d33327aa9e4b147757cba1bc9c764f0473f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 22 Dec 2022 15:03:17 +0100
Subject: [PATCH] Use File.exist?
`File.exists?` was deprecated while ago and removed in Ruby 3.2.
https://bugs.ruby-lang.org/issues/17391
https://github.com/ruby/ruby/pull/5352
Origin: https://github.com/thoughtbot/shoulda-context/commit/83370d3
---
bin/convert_to_should_syntax | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/convert_to_should_syntax b/bin/convert_to_should_syntax
index d1264d0..ebdda98 100755
--- a/bin/convert_to_should_syntax
+++ b/bin/convert_to_should_syntax
@@ -31,7 +31,7 @@ usage("Temp directory '#{TMP}' is not valid. Set TMPDIR environment variable to
file = ARGV.shift
tmpfile = File.join(TMP, File.basename(file))
-usage("File '#{file}' doesn't exist") unless File.exists?(file)
+usage("File '#{file}' doesn't exist") unless File.exist?(file)
FileUtils.cp(file, tmpfile)
contents = File.read(tmpfile)