v3 add branches endpoint
This commit is contained in:
parent
beaa4b7e17
commit
f44b374d79
7
lib/travis/api/v3/queries/branches.rb
Normal file
7
lib/travis/api/v3/queries/branches.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Travis::API::V3
|
||||
class Queries::Branches < Query
|
||||
def find(repository)
|
||||
repository.branches
|
||||
end
|
||||
end
|
||||
end
|
6
lib/travis/api/v3/renderer/branches.rb
Normal file
6
lib/travis/api/v3/renderer/branches.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
module Travis::API::V3
|
||||
class Renderer::Branches < Renderer::CollectionRenderer
|
||||
type :branches
|
||||
collection_key :branches
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
9
lib/travis/api/v3/services/branches/find.rb
Normal file
9
lib/travis/api/v3/services/branches/find.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
module Travis::API::V3
|
||||
class Services::Branches::Find < Service
|
||||
paginate
|
||||
def run!
|
||||
query.find(find(:repository))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user