Sha256: b1663d52ed6d887360a3e1c7ed73e5a89424df42e5aeb0be79eedacf076aedfb

Contents?: true

Size: 557 Bytes

Versions: 3

Compression:

Stored size: 557 Bytes

Contents

require 'google/api_client/auth/storage'

module GoogleDrive::CredentialStorage
  DEFAULE_FILE_STORE_PATH = '~/.google_drive-oauth2.json'

  class << self
    def store
      @store ||= Google::APIClient::FileStore.new(::File.expand_path(DEFAULE_FILE_STORE_PATH))
    end

    def store=(value)
      @store = value
    end
  end # of class methods

  def store
    GoogleDrive::CredentialStorage.store
  end

  def credential_stored?
    not store.load_credentials.nil?
  end

  def storage
    @storage ||= Google::APIClient::Storage.new(store)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
google_drive-persistent_session-0.3.0 lib/google_drive/persistent_session/credential_storage.rb
google_drive-persistent_session-0.2.0 lib/google_drive/persistent_session/credential_storage.rb
google_drive-persistent_session-0.1.4.beta lib/google_drive/persistent_session/credential_storage.rb