class Sshhub::PortAuthority
Public Class Methods
present?(keys)
click to toggle source
# File lib/sshhub/port_authority.rb, line 17 def self.present?(keys) ([*keys].map(&:key) & authorized_keys).any? end
revoke(keys)
click to toggle source
# File lib/sshhub/port_authority.rb, line 11 def self.revoke(keys) system('mkdir', '-p', "/Users/#{whoami}/.ssh") revoked = authorized_keys - [*keys].map(&:key) File.open(filename, "w"){|f| f.puts revoked } end
Private Class Methods
filename()
click to toggle source
# File lib/sshhub/port_authority.rb, line 29 def self.filename "/Users/#{whoami}/.ssh/authorized_keys" end
whoami()
click to toggle source
# File lib/sshhub/port_authority.rb, line 33 def self.whoami @whoami ||= `whoami`.rstrip end