Fix warning: File.exists? is deprecated
authorMike Moore <mike@blowmage.com>
Wed, 25 Mar 2015 23:06:20 +0000 (17:06 -0600)
committerMike Moore <mike@blowmage.com>
Wed, 25 Mar 2015 23:06:20 +0000 (17:06 -0600)
File.exist? should be used instead.
Might consider using File.file? instead of File.exist? since File.exist? will
return true when given the path of a file or a directory.

Addresses the following warning:

lib/google/api_client/service/simple_file_store.rb:127: warning: File.exists? is a deprecated name, use File.exist? instead

lib/google/api_client/service/simple_file_store.rb

index c9f510d5c0a0d2fee35fb678be2341a53c6431eb..216b3fac5ffb442d5588977967df9c3a32f09ede 100644 (file)
@@ -124,7 +124,7 @@ module Google
         # Read the entire cache file from disk.
         # Will avoid reading if there have been no changes.
         def read_file
-          if !File.exists? @file_path
+          if !File.exist? @file_path
             @cache = nil
           else
             # Check for changes after our last read or write.