Class: Git::Semaphore::API::Enrich
- Inherits:
-
Object
- Object
- Git::Semaphore::API::Enrich
- Defined in:
- lib/git/semaphore/api_enrich.rb
Class Method Summary collapse
- .history(project_hash_id, branch_id, auth_token) ⇒ Object
- .projects(auth_token) ⇒ Object
- .status(project_hash_id, branch_id, auth_token) ⇒ Object
Class Method Details
.history(project_hash_id, branch_id, auth_token) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/git/semaphore/api_enrich.rb', line 17 def self.history(project_hash_id, branch_id, auth_token) API.history(project_hash_id, branch_id, auth_token).tap do |history| history['builds'].each do |build| enrich(build) end end end |
.projects(auth_token) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/git/semaphore/api_enrich.rb', line 6 def self.projects(auth_token) API.projects(auth_token).tap do |results| results.each do |project| # full repository name on github.com: 'pvdb/git-semaphore' project['full_name'] = [project['owner'], project['name']].join('/') # https://semaphoreci.com/pvdb/git-semaphore -> https://github.com/pvdb/git-semaphore project['github_url'] = project['html_url'].sub(/semaphoreci\.com/, 'github.com') end end end |