Method: GoodData::Helpers::AuthHelper.read_token
- Defined in:
- lib/gooddata/helpers/auth_helpers.rb
.read_token(credentials_file_path = credentials_file) ⇒ String
Try read token
Tries to read it from ~/.gooddata file or from environment variable GD_PROJECT_TOKEN
56 57 58 59 |
# File 'lib/gooddata/helpers/auth_helpers.rb', line 56 def read_token(credentials_file_path = credentials_file) goodfile = read_credentials(credentials_file_path) [ENV['GD_PROJECT_TOKEN'], goodfile[:auth_token], goodfile[:token]].find { |x| !x.nil? && !x.empty? } end |