diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-01-26 08:21:19 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-02-02 11:50:43 -0800 |
commit | 5a2bab642653a715cd73be1f04062e37322b82a7 (patch) | |
tree | 0628a51dc69dfb2733bec04d612d065141192273 /lib/chef/file_cache.rb | |
parent | 96e1f6d3f52e0ce6e66087ede8b65bf342154a26 (diff) | |
download | chef-file_exists.tar.gz |
Replace deprecated File.exists? with File.exist? in more placesfile_exists
Just some boring cleanup
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/file_cache.rb')
-rw-r--r-- | lib/chef/file_cache.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/file_cache.rb b/lib/chef/file_cache.rb index 22060869da..851234596a 100644 --- a/lib/chef/file_cache.rb +++ b/lib/chef/file_cache.rb @@ -79,7 +79,7 @@ class Chef file_path_array = File.split(path) file_name = file_path_array.pop - if File.exists?(file) && File.writable?(file) + if File.exist?(file) && File.writable?(file) FileUtils.mv( file, File.join(create_cache_path(File.join(file_path_array), true), file_name) @@ -112,7 +112,7 @@ class Chef } ) cache_path = create_cache_path(path, false) - raise Chef::Exceptions::FileNotFound, "Cannot find #{cache_path} for #{path}!" unless File.exists?(cache_path) + raise Chef::Exceptions::FileNotFound, "Cannot find #{cache_path} for #{path}!" unless File.exist?(cache_path) if read File.read(cache_path) @@ -139,7 +139,7 @@ class Chef } ) cache_path = create_cache_path(path, false) - if File.exists?(cache_path) + if File.exist?(cache_path) File.unlink(cache_path) end true @@ -186,7 +186,7 @@ class Chef } ) full_path = create_cache_path(path, false) - if File.exists?(full_path) + if File.exist?(full_path) true else false |