module Authorizable

Public Instance Methods

authorize() click to toggle source
# File lib/tact/authorizable.rb, line 2
def authorize
  system("oauth2l fetch --json #{CLIENT_SECRET} https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/contacts.readonly")
end
authorized?() click to toggle source
# File lib/tact/authorizable.rb, line 6
def authorized?
  credentials = File.join(File.expand_path('~'), '.oauth2l.token')
  File.exists?(credentials) && !File.zero?(credentials)
end