Permalink
Browse files

Fix Travis error on Ruby 2.1.0. Better info for future errors.

  • Loading branch information...
pwnall committed Jan 12, 2014
1 parent 16c734b commit d9fcb6160e1df06a7f6a72318a8313057469dc29
Showing with 7 additions and 2 deletions.
  1. +1 −0 .travis.yml
  2. +6 −2 app/models/ssh_key.rb
View
@@ -8,6 +8,7 @@ before_script:
- "bundle exec rake db:migrate"
- "git config --global user.email tester@testing.com"
- "git config --global user.name \"Testing Tester\""
+script: "BACKTRACE=1 rake test"
rvm:
- 2.0.0
- 2.1.0
View
@@ -22,7 +22,12 @@ def key_line=(new_key_line)
def self.fingerprint(key_line)
return nil unless hex_key_blob = key_line.split(' ')[1]
key_blob = hex_key_blob.unpack('m*').first
- return nil unless ssh_key = Net::SSH::Buffer.new(key_blob).read_key
+ begin
+ return nil unless ssh_key = Net::SSH::Buffer.new(key_blob).read_key
+ rescue NotImplementedError
+ # NotImplementedError is thrown for some invalid key lines.
+ return nil
+ end
ssh_key.fingerprint
end
end
@@ -54,7 +59,6 @@ def keyfile_line
# Re-generates the file containing SSH keys for the git user.
def self.write_keyfile
- p keyfile_path
File.open(keyfile_path, 'w') do |f|
SshKey.all.each { |key| f.write key.keyfile_line + "\n" }
end

0 comments on commit d9fcb61

Please sign in to comment.