lib/shelly/user.rb in shelly-0.1.33 vs lib/shelly/user.rb in shelly-0.1.34.pre
- old
+ new
@@ -51,17 +51,27 @@
def delete_credentials
File.delete(credentials_path) if credentials_exists?
end
def delete_ssh_key
- shelly.logout(File.read(ssh_key_path)) if ssh_key_exists?
+ shelly.logout(File.read(dsa_key)) if File.exists?(dsa_key)
+ shelly.logout(File.read(rsa_key)) if File.exists?(rsa_key)
end
def ssh_key_exists?
File.exists?(ssh_key_path)
end
def ssh_key_path
+ return dsa_key if File.exists?(dsa_key)
+ rsa_key
+ end
+
+ def dsa_key
+ File.expand_path("~/.ssh/id_dsa.pub")
+ end
+
+ def rsa_key
File.expand_path("~/.ssh/id_rsa.pub")
end
def self.guess_email
@@guess_email ||= IO.popen("git config --get user.email").read.strip