From 8ab4900ebedd3a022f5107d559cfcbfb80d4b636 Mon Sep 17 00:00:00 2001 From: "Zsolt Sz. Sz. Raven" Date: Wed, 30 Apr 2025 03:38:32 +0100 Subject: [PATCH] Fix deprecation in os.rb File.exists? have been removed from ruby since 3.2.0. The correct method name is File.exist? --- lib/fluent/plugin/os.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/os.rb b/lib/fluent/plugin/os.rb index 87b6cfb..25b7c3c 100644 --- a/lib/fluent/plugin/os.rb +++ b/lib/fluent/plugin/os.rb @@ -34,7 +34,7 @@ def self.debian? def self.os_name_ubuntu? os_name = 'not_found' file_name = '/etc/os-release' - if File.exists?(file_name) + if File.exist?(file_name) IO.foreach(file_name).each do |line| if line.start_with?('ID=') os_name = line.split('=')[1].strip @@ -52,7 +52,7 @@ def self.os_name_ubuntu? def self.os_name_debian? os_name = 'not_found' file_name = '/etc/os-release' - if File.exists?(file_name) + if File.exist?(file_name) File.foreach(file_name).each do |line| if line.start_with?('ID=') os_name = line.split('=')[1].strip