Skip to content

Commit

Permalink
Replace obsolete File.exists? with File.exist?
Browse files Browse the repository at this point in the history
File.exists has been removed as of Ruby 3.2:
https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Feb 3, 2023
1 parent 44b5d38 commit 289d993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/fluent/plugin/opensearch_index_template.rb
Expand Up @@ -29,15 +29,15 @@

module Fluent::OpenSearchIndexTemplate
def get_template(template_file)
if !File.exists?(template_file)
if !File.exist?(template_file)
raise "If you specify a template_name you must specify a valid template file (checked '#{template_file}')!"
end
file_contents = IO.read(template_file).gsub(/\n/,'')
JSON.parse(file_contents)
end

def get_custom_template(template_file, customize_template)
if !File.exists?(template_file)
if !File.exist?(template_file)
raise "If you specify a template_name you must specify a valid template file (checked '#{template_file}')!"
end
file_contents = IO.read(template_file).gsub(/\n/,'')
Expand Down

0 comments on commit 289d993

Please sign in to comment.