Replace deprecated method that cause ruby warnings File.exit?
authorAbdelkader Boudih <terminale@gmail.com>
Wed, 17 Sep 2014 14:55:52 +0000 (14:55 +0000)
committerAbdelkader Boudih <terminale@gmail.com>
Wed, 8 Oct 2014 12:02:36 +0000 (12:02 +0000)
lib/google/api_client/auth/file_storage.rb
lib/google/api_client/client_secrets.rb
lib/google/api_client/service.rb
tasks/wiki.rake

index 049ef965a9ad1b817b4830a789f2c012846a558f..fca4ea39ae149d05fad5360865cd9a60662bfd7a 100644 (file)
@@ -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)
index 93b0046a88e10cc2beb645f2d18c3da676e2777a..0432671d42e0bff066cd87f373412a26ce0ece76 100644 (file)
@@ -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,
index 451266fe56e9d27404a7d205b91e2f9ebefcaa47..685c61780934f5a75db106c24bf5c0736b94e2e2 100755 (executable)
@@ -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(
index 12bfe4bf06e546cae7d63023fd0d70286b5becba..3e0d97d2e39d4f1b8901e70e4d59a1b59a1c5720 100644 (file)
@@ -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