class Travis::CLI::Pubkey

Attributes

key_format[RW]

Public Instance Methods

run() click to toggle source
# File lib/travis/cli/pubkey.rb, line 11
def run
  error "#{key_format} format not supported by #{api_endpoint}" unless key
  say key, "Public key for #{color(repository.slug, :info)}:\n\n%s", :bold
end

Private Instance Methods

key() click to toggle source
# File lib/travis/cli/pubkey.rb, line 18
def key
  key = repository.public_key
  case self.key_format ||= :ssh
  when :fingerprint then key.fingerprint
  when :pem         then key.to_s
  when :ssh         then key.to_ssh
  else raise "unknown format #{key_format}"
  end
end