From e313235b5561e1a9fbd83a7bf9406f79faae6526 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Wed, 17 Sep 2014 14:55:52 +0000 Subject: [PATCH] Replace deprecated method that cause ruby warnings File.exit? --- lib/google/api_client/auth/file_storage.rb | 2 +- lib/google/api_client/client_secrets.rb | 2 +- lib/google/api_client/service.rb | 2 +- tasks/wiki.rake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/google/api_client/auth/file_storage.rb b/lib/google/api_client/auth/file_storage.rb index 049ef965a..fca4ea39a 100644 --- a/lib/google/api_client/auth/file_storage.rb +++ b/lib/google/api_client/auth/file_storage.rb @@ -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) diff --git a/lib/google/api_client/client_secrets.rb b/lib/google/api_client/client_secrets.rb index 93b0046a8..0432671d4 100644 --- a/lib/google/api_client/client_secrets.rb +++ b/lib/google/api_client/client_secrets.rb @@ -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, diff --git a/lib/google/api_client/service.rb b/lib/google/api_client/service.rb index 451266fe5..685c61780 100755 --- a/lib/google/api_client/service.rb +++ b/lib/google/api_client/service.rb @@ -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( diff --git a/tasks/wiki.rake b/tasks/wiki.rake index 12bfe4bf0..3e0d97d2e 100644 --- a/tasks/wiki.rake +++ b/tasks/wiki.rake @@ -38,7 +38,7 @@ WIKI output.gsub!(/-32\./, "-16.") wiki_path = File.expand_path( File.join(File.dirname(__FILE__), '../wiki/')) - Dir.mkdir(wiki_path) if !File.exist?(wiki_path) + Dir.mkdir(wiki_path) unless File.exists?(wiki_path) File.open(File.join(wiki_path, 'SupportedAPIs.wiki'), 'w') do |file| file.write(output) end