lib/git/semaphore/api_cache.rb in git-semaphore-1.0.0 vs lib/git/semaphore/api_cache.rb in git-semaphore-1.1.0
- old
+ new
@@ -25,10 +25,16 @@
@history ||= Git::Semaphore.from_json_cache(history_cache(project_hash_id, branch_id)) do
API::Enrich.history project_hash_id, branch_id, auth_token
end
end
+ def self.information project_hash_id, branch_id, build_number, auth_token
+ @information ||= Git::Semaphore.from_json_cache(information_cache(project_hash_id, branch_id, build_number)) do
+ API.information project_hash_id, branch_id, build_number, auth_token
+ end
+ end
+
# private helper functions
def self.projects_cache
File.join(Git::Semaphore.cache_dir, 'projects.json')
end
@@ -50,9 +56,15 @@
def self.history_cache project_hash_id, branch_id
File.join(Git::Semaphore.cache_dir_for(project_hash_id), "#{branch_id}_history.json")
end
private_class_method :history_cache
+
+ def self.information_cache project_hash_id, branch_id, build_number
+ File.join(Git::Semaphore.cache_dir_for(project_hash_id), "#{branch_id}_#{build_number}_information.json")
+ end
+
+ private_class_method :information_cache
end
end
end
end