mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Replace deprecated File.exists? method
Done with `rubocop --auto-correct --only DeprecatedClassMethods`
This commit is contained in:
parent
ec8b940b2c
commit
698bca3f10
4 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue