lib/travis/client/repository.rb in travis-1.4.0 vs lib/travis/client/repository.rb in travis-1.5.0
- old
+ new
@@ -53,11 +53,11 @@
time :last_build_finished_at, :last_build_started_at
one :repo
many :repos
- aka :repository
+ aka :repository, :permissions
def public_key
attributes["public_key"] ||= begin
payload = session.get_raw("/repos/#{id}/key")
Key.new(payload.fetch('key'))
@@ -150,9 +150,17 @@
set_hook(false)
end
def enable
set_hook(true)
+ end
+
+ def pusher_channels
+ attributes['pusher_channels'] ||= if session.private_channels?
+ ["user-#{session.user.id}", "repo-#{id}"]
+ else
+ ["common"]
+ end
end
private
def state