1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Description: Fix use of File.exists removed with Ruby 3.2.0
Method File.exists was deprecated with Ruby 2.2.0 and removed with Ruby 3.2.0
according to
https://www.reddit.com/r/ruby/comments/1196wti/psa_and_a_little_rant_fileexists_direxists/.
Author: Sven Geuer <sge@debian.org>
Bug: https://github.com/Aorimn/dislocker/issues/298
Forwarded: no
Last-Update: 2025-02-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/dislocker-find.rb.in
+++ b/src/dislocker-find.rb.in
@@ -32,7 +32,7 @@
uname = nil
reps = %w(/bin/ /usr/bin/ /sbin/ /usr/sbin/)
reps.each do |rep|
- uname = "#{rep}uname" if File.exists?("#{rep}uname")
+ uname = "#{rep}uname" if File.exist?("#{rep}uname")
end
if uname.nil?
@@ -138,7 +138,7 @@
encrypted_devices = []
devices.each do |dev|
- next unless File.exists? dev
+ next unless File.exist? dev
encrypted_devices << dev if is_bitlocker_encrypted? dev
end
|