Blimpy::Keys

Public Class Methods

key_name() click to toggle source
# File lib/blimpy/keys.rb, line 17
def self.key_name
  "Blimpy-#{ENV['USER']}-#{Socket.gethostname}"
end
public_key() click to toggle source
# File lib/blimpy/keys.rb, line 5
def self.public_key
  filename = File.expand_path('~/.ssh/id_rsa.pub')
  unless File.exists? filename
    filename = File.expand_path('~/.ssh/id_dsa.pub')
    unless File.exists? filename
      raise Blimpy::SSHKeyNotFoundError, 'Expected either ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub but found neither'
    end
  end

  File.open(filename, 'r').read
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.