lib/git/semaphore/api.rb in git-semaphore-1.0.0 vs lib/git/semaphore/api.rb in git-semaphore-1.1.0

- old
+ new

@@ -18,10 +18,14 @@ get_paginated_response(history_uri(project_hash_id, branch_id, auth_token)) do |previous_page, next_page| previous_page['builds'] += next_page['builds'] end end + def self.information project_hash_id, branch_id, build_number, auth_token + get_json information_uri(project_hash_id, branch_id, build_number, auth_token) + end + def self.rebuild project_hash_id, branch_id, auth_token get_json last_revision_uri(project_hash_id, branch_id, auth_token), :post end # private helper functions @@ -55,9 +59,17 @@ # GET /api/v1/projects/:hash_id/:id request_uri(auth_token, :path => File.join('projects', project_hash_id, branch_id), :page => page) end private_class_method :history_uri + + def self.information_uri project_hash_id, branch_id, build_number, auth_token + # https://semaphoreci.com/docs/branches-and-builds-api.html#build_information + # GET /api/v1/projects/:hash_id/:id/builds/:number + request_uri(auth_token, :path => File.join('projects', project_hash_id, branch_id, 'builds', build_number)) + end + + private_class_method :information_uri def self.last_revision_uri project_hash_id, branch_id, auth_token # https://semaphoreci.com/docs/branches-and-builds-api.html#rebuild # POST /api/v1/projects/:project_hash_id/:branch_id/build request_uri(auth_token, :path => File.join('projects', project_hash_id, branch_id, 'build'))