#189 - Fix legacy file storage
This commit is contained in:
parent
21cd5b27b1
commit
28adb02b60
|
@ -29,12 +29,10 @@ module Google
|
||||||
#
|
#
|
||||||
class FileStorage
|
class FileStorage
|
||||||
|
|
||||||
attr_accessor :storage,
|
attr_accessor :storage
|
||||||
:path
|
|
||||||
|
|
||||||
def initialize(path)
|
def initialize(path)
|
||||||
@path = path
|
store = Google::APIClient::FileStore.new(path)
|
||||||
store = Google::APIClient::FileStore.new(@path)
|
|
||||||
@storage = Google::APIClient::Storage.new(store)
|
@storage = Google::APIClient::Storage.new(store)
|
||||||
@storage.authorize
|
@storage.authorize
|
||||||
end
|
end
|
||||||
|
@ -54,8 +52,7 @@ module Google
|
||||||
# Optional authorization instance. If not provided, the authorization
|
# Optional authorization instance. If not provided, the authorization
|
||||||
# already associated with this instance will be written.
|
# already associated with this instance will be written.
|
||||||
def write_credentials(auth=nil)
|
def write_credentials(auth=nil)
|
||||||
self.authorization = auth unless auth.nil?
|
storage.write_credentials(auth)
|
||||||
storage.write_credentials(self.authorization)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -77,7 +77,7 @@ module Google
|
||||||
##
|
##
|
||||||
# Request authorization. Opens a browser and waits for response.
|
# Request authorization. Opens a browser and waits for response.
|
||||||
#
|
#
|
||||||
# @param [Google::APIClient::FileStorage] storage
|
# @param [Google::APIClient::Storage] storage
|
||||||
# Optional object that responds to :write_credentials, used to serialize
|
# Optional object that responds to :write_credentials, used to serialize
|
||||||
# the OAuth 2 credentials after completing the flow.
|
# the OAuth 2 credentials after completing the flow.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue