diff --git a/lib/fog/joyent/analytics.rb b/lib/fog/joyent/analytics.rb index 4a9f0ec7a..8742d7b2b 100644 --- a/lib/fog/joyent/analytics.rb +++ b/lib/fog/joyent/analytics.rb @@ -166,7 +166,7 @@ module Fog @header_method = method(:header_for_signature_auth) if options[:joyent_keyfile] - if File.exists?(options[:joyent_keyfile]) + if File.exist?(options[:joyent_keyfile]) @joyent_keyfile = options[:joyent_keyfile] @key_manager.add(@joyent_keyfile) else diff --git a/lib/fog/joyent/compute.rb b/lib/fog/joyent/compute.rb index 538bbe49c..c3965fece 100644 --- a/lib/fog/joyent/compute.rb +++ b/lib/fog/joyent/compute.rb @@ -135,7 +135,7 @@ module Fog @header_method = method(:header_for_signature_auth) if options[:joyent_keyfile] - if File.exists?(options[:joyent_keyfile]) + if File.exist?(options[:joyent_keyfile]) @joyent_keyfile = options[:joyent_keyfile] @key_manager.add(@joyent_keyfile) else diff --git a/lib/fog/local/models/storage/file.rb b/lib/fog/local/models/storage/file.rb index d8a871c50..ea083dfc9 100644 --- a/lib/fog/local/models/storage/file.rb +++ b/lib/fog/local/models/storage/file.rb @@ -46,7 +46,7 @@ module Fog def destroy requires :directory, :key - ::File.delete(path) if ::File.exists?(path) + ::File.delete(path) if ::File.exist?(path) dirs = path.split(::File::SEPARATOR)[0...-1] dirs.length.times do |index| dir_path = dirs[0..-index].join(::File::SEPARATOR) @@ -58,7 +58,7 @@ module Fog break end pwd = Dir.pwd - if ::File.exists?(dir_path) && ::File.directory?(dir_path) + if ::File.exist?(dir_path) && ::File.directory?(dir_path) Dir.chdir(dir_path) if Dir.glob('*').empty? Dir.rmdir(dir_path) @@ -102,7 +102,7 @@ module Fog file = ::File.new(path, 'wb') if body.is_a?(String) file.write(body) - elsif body.kind_of? ::File and ::File.exists?(body.path) + elsif body.kind_of? ::File and ::File.exist?(body.path) FileUtils.cp(body.path, path) else file.write(body.read) diff --git a/lib/fog/local/models/storage/files.rb b/lib/fog/local/models/storage/files.rb index 379dd49e1..e701202ee 100644 --- a/lib/fog/local/models/storage/files.rb +++ b/lib/fog/local/models/storage/files.rb @@ -34,7 +34,7 @@ module Fog def get(key, &block) requires :directory path = file_path(key) - if ::File.exists?(path) + if ::File.exist?(path) data = { :content_length => ::File.size(path), :key => key, @@ -57,7 +57,7 @@ module Fog def head(key) requires :directory path = file_path(key) - if ::File.exists?(path) + if ::File.exist?(path) new({ :content_length => ::File.size(path), :key => key,