Class: Shacho::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/shacho/key.rb

Class Method Summary collapse

Class Method Details

.generate(account) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/shacho/key.rb', line 5

def self.generate()\
   = "#{HEROKU_PREFIX}/accounts/#{}/.ssh"
  if !File.exists?()
    FileUtils.mkdir_p 
    FileUtils.chmod 0700, "#{}"
  end
  # TODO listen for options
  # TODO better way of suppressing bash output
  `ssh-keygen -f #{}/id_rsa`
end

.use(account) ⇒ Object



16
17
18
19
# File 'lib/shacho/key.rb', line 16

def self.use()
   = "#{HEROKU_PREFIX}/accounts/#{}/.ssh"
  `heroku keys:add #{}/id_rsa.pub`
end