diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-11-21 21:34:19 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-11-27 15:04:01 -0800 |
commit | 6b2f219f13b7d28ee9277f98bf11e69903fefc92 (patch) | |
tree | ce287b5e1e9674c6a2db05ecd712c2493cb6a450 /lib/chef/file_cache.rb | |
parent | 8bd0da60b8b5867566b4a2fbf339c7c97eb8bd6a (diff) | |
download | chef-exists.tar.gz |
Convert the last our of File.exists? to File.exist?exists
Standardize on the new method
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 |