lib/travis/client/repository.rb in travis-1.6.18.travis.607.5 vs lib/travis/client/repository.rb in travis-1.6.18.travis.608.5
- old
+ new
@@ -3,14 +3,15 @@
module Travis
module Client
class Repository < Entity
class Key
- attr_reader :to_s
+ attr_reader :to_s, :fingerprint
- def initialize(data)
+ def initialize(data, fingerprint)
@to_s = data
+ @fingerprint = fingerprint
end
def encrypt(value)
encrypted = to_rsa.public_encrypt(value)
Base64.encode64(encrypted).gsub(/\s+/, "")
@@ -50,20 +51,19 @@
end
def public_key
attributes["public_key"] ||= begin
payload = session.get_raw("/repos/#{id}/key")
- Key.new(payload.fetch('key'))
+ Key.new(payload.fetch('key'), payload.fetch('fingerprint'))
end
end
def name
slug[/[^\/]+$/]
end
def public_key=(key)
- key = Key.new(key) unless key.is_a? Key
- set_attribute(:public_key, key)
+ # ignored
end
alias key public_key
alias key= public_key=