From a7a926d78f42e70d3b3b1560e9fdebc4c9c80d01 Mon Sep 17 00:00:00 2001 From: golirev Date: Thu, 27 Jun 2024 00:38:50 +0900 Subject: [PATCH] Make usable after Ruby 3.2 on Windows Need to use File.exist? since File.exists? has been removed at Ruby 3.2. At least, File.exist? has existed since Ruby 2.1, so this change shouldn't cause any problems. --- lib/rinruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rinruby.rb b/lib/rinruby.rb index 5ef4d59..6e237b5 100644 --- a/lib/rinruby.rb +++ b/lib/rinruby.rb @@ -1011,7 +1011,7 @@ def find_R_on_windows(cygwin = false) ['bin', 'bin/x64', 'bin/i386'].product( cygwin ? [path.gsub(' ','\ '), path] : [path.gsub('\\','/')]).each{|bin_dir, base_dir| r_exe = File::join(base_dir, bin_dir, "Rterm.exe") - return %Q<"#{r_exe}"> if File.exists?(r_exe) + return %Q<"#{r_exe}"> if File.exist?(r_exe) } } raise "Cannot locate R executable"