v3 add branches endpoint

This commit is contained in:
carlad 2015-09-07 17:09:05 +02:00
parent beaa4b7e17
commit f44b374d79
5 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,7 @@
module Travis::API::V3
class Queries::Branches < Query
def find(repository)
repository.branches
end
end
end

View File

@ -0,0 +1,6 @@
module Travis::API::V3
class Renderer::Branches < Renderer::CollectionRenderer
type :branches
collection_key :branches
end
end

View File

@ -12,6 +12,9 @@ module Travis::API::V3
capture id: :digit
route '/build/{build.id}'
get :find
# post :cancel, '/cancel'
# post :restart, '/restart'
end
resource :job do

View File

@ -4,6 +4,7 @@ module Travis::API::V3
Accounts = Module.new { extend Services }
Branch = Module.new { extend Services }
Branch = Module.new { extend Services }
Build = Module.new { extend Services }
Builds = Module.new { extend Services }
Job = Module.new { extend Services }

View File

@ -0,0 +1,9 @@
module Travis::API::V3
class Services::Branches::Find < Service
paginate
def run!
query.find(find(:repository))
end
end
end