Class: Git::Semaphore::API::Cache

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

Class Method Summary collapse

Class Method Details

.branches(project_hash_id, refresh) ⇒ Object



12
13
14
15
16
# File 'lib/git/semaphore/api_cache.rb', line 12

def self.branches(project_hash_id, refresh)
  @branches ||= Git::Semaphore.from_json_cache(branches_cache(project_hash_id), refresh) do
    API.branches project_hash_id
  end
end

.history(project_hash_id, branch_id, refresh) ⇒ Object



24
25
26
27
28
# File 'lib/git/semaphore/api_cache.rb', line 24

def self.history(project_hash_id, branch_id, refresh)
  @history ||= Git::Semaphore.from_json_cache(history_cache(project_hash_id, branch_id), refresh) do
    API::Enrich.history project_hash_id, branch_id
  end
end

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



30
31
32
33
34
# File 'lib/git/semaphore/api_cache.rb', line 30

def self.information(project_hash_id, branch_id, build_number, refresh)
  @information ||= Git::Semaphore.from_json_cache(information_cache(project_hash_id, branch_id, build_number), refresh) do
    API.information project_hash_id, branch_id, build_number
  end
end

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



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

def self.log(project_hash_id, branch_id, build_number, refresh)
  @log ||= Git::Semaphore.from_json_cache(log_cache(project_hash_id, branch_id, build_number), refresh) do
    API.log project_hash_id, branch_id, build_number
  end
end

.projects(refresh) ⇒ Object



6
7
8
9
10
# File 'lib/git/semaphore/api_cache.rb', line 6

def self.projects(refresh)
  @projects ||= Git::Semaphore.from_json_cache(projects_cache, refresh) do
    API::Enrich.projects
  end
end

.status(project_hash_id, branch_id, refresh) ⇒ Object



18
19
20
21
22
# File 'lib/git/semaphore/api_cache.rb', line 18

def self.status(project_hash_id, branch_id, refresh)
  @status ||= Git::Semaphore.from_json_cache(status_cache(project_hash_id, branch_id), refresh) do
    API::Enrich.status project_hash_id, branch_id
  end
end