Sha256: 5b2e7ff1b9035d4be21cfd02c8533a4fc4b29ae15d695de6f29229fd35d990b5

Contents?: true

Size: 515 Bytes

Versions: 2

Compression:

Stored size: 515 Bytes

Contents

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

2 entries across 2 versions & 1 rubygems

Version Path
google_drive-persistent_session-0.1.3 lib/google_drive/persistent_session/credential_storage.rb
google_drive-persistent_session-0.1.2 lib/google_drive/persistent_session/credential_storage.rb