Class: Git::Semaphore::API

Inherits:
Object
  • Object
show all
Defined in:
lib/git/semaphore/api.rb,
lib/git/semaphore/api_cache.rb,
lib/git/semaphore/api_enrich.rb

Defined Under Namespace

Classes: Cache, Enrich

Constant Summary collapse

SEMAPHORE_API_HOST =
'semaphoreci.com'.freeze
SEMAPHORE_API_URI =
'/api/v1/'.freeze

Class Method Summary collapse

Class Method Details

.branches(project_hash_id, auth_token) ⇒ Object



9
10
11
# File 'lib/git/semaphore/api.rb', line 9

def self.branches project_hash_id, auth_token
  get_json branches_uri(project_hash_id, auth_token)
end

.history(project_hash_id, branch_id, auth_token) ⇒ Object



17
18
19
20
21
# File 'lib/git/semaphore/api.rb', line 17

def self.history project_hash_id, branch_id, auth_token
  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

.information(project_hash_id, branch_id, build_number, auth_token) ⇒ Object



23
24
25
# File 'lib/git/semaphore/api.rb', line 23

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

.log(project_hash_id, branch_id, build_number, auth_token) ⇒ Object



27
28
29
# File 'lib/git/semaphore/api.rb', line 27

def self.log project_hash_id, branch_id, build_number, auth_token
  get_json log_uri(project_hash_id, branch_id, build_number, auth_token)
end

.projects(auth_token) ⇒ Object



5
6
7
# File 'lib/git/semaphore/api.rb', line 5

def self.projects auth_token
  get_json projects_uri(auth_token)
end

.rebuild(project_hash_id, branch_id, auth_token) ⇒ Object



31
32
33
# File 'lib/git/semaphore/api.rb', line 31

def self.rebuild project_hash_id, branch_id, auth_token
  get_json last_revision_uri(project_hash_id, branch_id, auth_token), :post
end

.status(project_hash_id, branch_id, auth_token) ⇒ Object



13
14
15
# File 'lib/git/semaphore/api.rb', line 13

def self.status project_hash_id, branch_id, auth_token
  get_json status_uri(project_hash_id, branch_id, auth_token)
end