class Race::Run::Info

Public Instance Methods

change(*_args) click to toggle source
# File lib/system/run/commands/info.rb, line 9
def change(*_args)
  config = Netrc.read("#{(ENV['HOME'] || './')}/race.netrc")
  api_key = [(print 'Access Tokens: '), STDIN.gets.rstrip][1]
  client_id = 'empty'
  if api_key.empty?
    puts 'Please fill all fields'.red
  else
    config['api.digitalocean.com'] = api_key, client_id
    config.save
    puts 'Informations is changed'.red
  end
end
show() click to toggle source
# File lib/system/run/commands/info.rb, line 4
def show
  puts "Access Tokens: #{Race::Config.get('api_key')}".yellow
end