Class: Awesomekit::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/awesomekit/authenticator.rb

Constant Summary collapse

CONFIG_FILE =
'.typekit'

Class Method Summary collapse

Class Method Details

.api_tokenObject

PUBLIC: Return the current saved api_token If no token exists, prompt user for token



7
8
9
10
11
12
13
# File 'lib/awesomekit/authenticator.rb', line 7

def self.api_token
  if File.exist?(config)
    File.open(config, 'r').gets
  else
    prompt_user_for_token
  end
end

.clear_api_tokenObject

PUBLIC: Delete any existing api_token config file



16
17
18
# File 'lib/awesomekit/authenticator.rb', line 16

def self.clear_api_token
  File.unlink(config) if File.exist?(config)
end