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

Class Method Summary collapse

Class Method Details

.branches(project_hash_id) ⇒ Object



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

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

.get_json(uri) ⇒ Object

private helper functions



37
38
39
40
# File 'lib/git/semaphore/api.rb', line 37

def self.get_json(uri)
  @client ||= SemaphoreCI::API::V1.new(Git::Semaphore.auth_token)
  @client.get(uri)
end

.history(project_hash_id, branch_id) ⇒ Object



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

def self.history(project_hash_id, branch_id)
  get_json history_uri(project_hash_id, branch_id)
end

.information(project_hash_id, branch_id, build_number) ⇒ Object



21
22
23
# File 'lib/git/semaphore/api.rb', line 21

def self.information(project_hash_id, branch_id, build_number)
  get_json information_uri(project_hash_id, branch_id, build_number)
end

.log(project_hash_id, branch_id, build_number) ⇒ Object



25
26
27
# File 'lib/git/semaphore/api.rb', line 25

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

.projectsObject



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

def self.projects
  get_json projects_uri
end

.rebuild(project_hash_id, branch_id) ⇒ Object



29
30
31
# File 'lib/git/semaphore/api.rb', line 29

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

.status(project_hash_id, branch_id) ⇒ Object



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

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