class RHC::Commands::Account

Public Instance Methods

logout() click to toggle source
# File lib/rhc/commands/account.rb, line 38
def logout
  if options.all
    rest_client.user # force authentication
    say "Deleting all authorizations associated with your account ... "
    begin
      rest_client.delete_authorizations
      success "done"
    rescue RHC::Rest::AuthorizationsNotSupported
      info "not supported"
    end
  elsif options.token
    options.noprompt = true
    say "Ending session on server ... "
    begin
      rest_client.delete_authorization(options.token)
      success "deleted"
    rescue RHC::Rest::AuthorizationsNotSupported
      info "not supported"
    rescue RHC::Rest::TokenExpiredOrInvalid
      info "already closed"
    rescue => e
      debug_error(e)
      warn e.message
    end
  end

  0
ensure
  token_store.clear
  success "All local sessions removed."
end
run() click to toggle source
# File lib/rhc/commands/account.rb, line 12
def run
  user = rest_client.user

  say_table nil, get_properties(user, :login, :plan_id, :consumed_gears, :max_gears) + get_properties(user.capabilities, :gear_sizes).unshift(['Server:', openshift_server]) << ['SSL Certificates Supported:', user.capabilities.private_ssl_certificates ? 'yes' : 'no'], :delete => true

  if openshift_online_server?
  else
  end

  0
end