class Oc::Run::Info

Public Instance Methods

change(*args) click to toggle source
# File lib/system/run/commands/info.rb, line 10
def change(*args)
  config = Netrc.read("#{(ENV["HOME"] || "./")}/oc.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 5
def show
  puts "Access Tokens: #{Oc::Config.get("api_key")}".yellow
end