Class: Shacho::Key
- Inherits:
-
Object
- Object
- Shacho::Key
- 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(account)\ account_path = "#{HEROKU_PREFIX}/accounts/#{account}/.ssh" if !File.exists?(account_path) FileUtils.mkdir_p account_path FileUtils.chmod 0700, "#{account_path}" end # TODO listen for options # TODO better way of suppressing bash output `ssh-keygen -f #{account_path}/id_rsa` end |
.use(account) ⇒ Object
16 17 18 19 |
# File 'lib/shacho/key.rb', line 16 def self.use(account) account_path = "#{HEROKU_PREFIX}/accounts/#{account}/.ssh" `heroku keys:add #{account_path}/id_rsa.pub` end |