Skip to content

Commit 2de34c8

Browse files
ekohlLukasAud
authored andcommitted
Remove deprecated File.exists?
In 7999ff2 the cops were disabled, but Ruby 3.2 has removed the method.
1 parent 5accef0 commit 2de34c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/puppet/parser/functions/loadjson.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ module Puppet::Parser::Functions
5050
warning("Can't load '#{url}' HTTP Error Code: '#{res.status[0]}'")
5151
args[1]
5252
end
53+
5354
if Puppet::Util::Package.versioncmp(Puppet.version, '8.0.0').negative?
5455
PSON.load(contents) || args[1]
5556
else
5657
JSON.parse(contents) || args[1]
5758
end
58-
elsif File.exist?(args[0]) # rubocop:disable Lint/DeprecatedClassMethods : Changing to .exist? breaks the code
59+
elsif File.exist?(args[0])
5960
content = File.read(args[0])
6061
if Puppet::Util::Package.versioncmp(Puppet.version, '8.0.0').negative?
6162
PSON.load(content) || args[1]

0 commit comments

Comments
 (0)