This repository was archived by the owner on Nov 1, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathstatus.rb
More file actions
44 lines (41 loc) · 1.42 KB
/
status.rb
File metadata and controls
44 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module GitHub
module Resources
module Responses
SIMPLE_STATUS ||= {
"created_at" => "2012-07-20T01:19:13Z",
"updated_at" => "2012-07-20T01:19:13Z",
"state" => "success",
"target_url" => "https://ci.example.com/1000/output",
"description" => "Build has completed successfully",
"id" => 1,
"url" => "https://api.github.com/repos/octocat/Hello-World/statuses/1",
"context" => "continuous-integration/jenkins"
}
OTHER_SIMPLE_STATUS ||= {
"created_at" => "2012-08-20T01:19:13Z",
"updated_at" => "2012-08-20T01:19:13Z",
"state" => "success",
"target_url" => "https://ci.example.com/2000/output",
"description" => "Testing has completed successfully",
"id" => 2,
"url" => "https://api.github.com/repos/octocat/Hello-World/statuses/2",
"context" => "security/brakeman"
}
STATUS ||= SIMPLE_STATUS.merge(
"creator" => USER
)
COMBINED_STATUS ||= {
"state" => "success",
"sha" => COMMIT["sha"],
"total_count" => 2,
"statuses" => [
SIMPLE_STATUS,
OTHER_SIMPLE_STATUS
],
"repository" => SIMPLE_REPO,
"commit_url" => "https://api.github.com/repos/octocat/Hello-World/#{COMMIT["sha"]}",
"url" => "https://api.github.com/repos/octocat/Hello-World/#{COMMIT["sha"]}/status"
}
end
end
end