Replace deprecated method that cause ruby warnings File.exit?
This commit is contained in:
1 parent
27df982625
commit
e313235b55
4 files changed
+4
-4
No files matched your search
@@ -42,7 +42,7 @@ module Google
|
||||
##
|
||||
# Attempt to read in credentials from the specified file.
|
||||
def load_credentials
|
||||
if File.exist? self.path
|
||||
if File.exists? self.path
|
||||
File.open(self.path, 'r') do |file|
|
||||
cached_credentials = JSON.load(file)
|
||||
@authorization = Signet::OAuth2::Client.new(cached_credentials)
|
||||
|
||||
@@ -63,7 +63,7 @@ module Google
|
||||
end
|
||||
while filename == nil
|
||||
search_path ||= File.expand_path('.')
|
||||
if File.exist?(File.join(search_path, 'client_secrets.json'))
|
||||
if File.exists?(File.join(search_path, 'client_secrets.json'))
|
||||
filename = File.join(search_path, 'client_secrets.json')
|
||||
elsif search_path == '/' || search_path =~ /[a-zA-Z]:[\/\\]/
|
||||
raise ArgumentError,
|
||||
|
||||
@@ -120,7 +120,7 @@ module Google
|
||||
if options.include? :cache_store
|
||||
@cache_store = options[:cache_store]
|
||||
else
|
||||
cache_exists = File.exist?(DEFAULT_CACHE_FILE)
|
||||
cache_exists = File.exists?(DEFAULT_CACHE_FILE)
|
||||
if (cache_exists && File.writable?(DEFAULT_CACHE_FILE)) ||
|
||||
(!cache_exists && File.writable?(Dir.pwd))
|
||||
@cache_store = Google::APIClient::Service::SimpleFileStore.new(
|
||||
|
||||
Reference in new issue
Block a user