Skip to content

Commit

Permalink
Have SSHKey.to_file return the path for the new file
Browse files Browse the repository at this point in the history
  • Loading branch information
wingrunr21 committed Jan 31, 2011
1 parent 9889dc7 commit 4a65696
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gitolite/ssh_key.rb
Expand Up @@ -44,10 +44,12 @@ def to_s
[@type, @blob, @email].join(' ')
end

def to_file(filename)
File.open(filename, "w") do |f|
def to_file(path)
key_file = File.join(path, self.filename)
File.open(key_file, "w") do |f|
f.write (self.to_s)
end
key_file
end

def filename
Expand Down

0 comments on commit 4a65696

Please sign in to comment.