Module: DriveEnv

Defined in:
lib/drive_env.rb,
lib/drive_env/cli.rb,
lib/drive_env/config.rb,
lib/drive_env/version.rb,
lib/drive_env/cli/auth.rb,
lib/drive_env/cli/config.rb,
lib/drive_env/cli/command.rb,
lib/drive_env/cli/spreadsheet.rb

Defined Under Namespace

Modules: Cli Classes: Config

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.authorizer(client_id, client_secret, token_store_file) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/drive_env.rb', line 10

def authorizer(client_id, client_secret, token_store_file)
  unless @authorizer
    client_id = Google::Auth::ClientId.new(client_id, client_secret)
    scope = %w[
      https://www.googleapis.com/auth/drive
      https://spreadsheets.google.com/feeds/
    ]
    token_store = Google::Auth::Stores::FileTokenStore.new(file: token_store_file)
    @authorizer = Google::Auth::UserAuthorizer.new(client_id, scope, token_store)
  end
  @authorizer
end