octocheck 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octocheck/api.rb +3 -1
- data/lib/octocheck/cli.rb +12 -0
- data/lib/octocheck/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f7d809cad3d2620ae32a0f321618789509d1b9a77b4ca2f2985bfa4d269843
|
4
|
+
data.tar.gz: d74d3d00e7f91649f2229561b82c3a49e9b7e61497e20ac3e7e55685a1c1f632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b76ccf93aba07bdfff4cbf6435ebdd392cde44e6e7b263df63d3b57a16b3817674045aa64843f132fe4d31a8fbd415b99cd8f31c026d6cb6939f7f729eaddf
|
7
|
+
data.tar.gz: a0dea79fd39fe38ee09af3752987a7379fb66b382a100e575d05bc3a0dc8f8f62ebca900653ea5e4ebb2f871c1919fcbd24a50efaf3151f75996fcf9dc66f25e
|
data/lib/octocheck/api.rb
CHANGED
@@ -4,6 +4,8 @@ require "json"
|
|
4
4
|
|
5
5
|
module Octocheck
|
6
6
|
class Api
|
7
|
+
NotFoundError = Class.new(RuntimeError)
|
8
|
+
|
7
9
|
attr_accessor :org, :branch, :repo, :token
|
8
10
|
def initialize(org:, branch:, repo:, token:)
|
9
11
|
@org = org
|
@@ -90,7 +92,7 @@ module Octocheck
|
|
90
92
|
end
|
91
93
|
http.use_ssl = true
|
92
94
|
response = http.request(request)
|
93
|
-
raise "request failure:\n\n#{response.body}" unless response.code == "200"
|
95
|
+
raise NotFoundError.new("request failure:\n\n#{response.body}") unless response.code == "200"
|
94
96
|
JSON.parse(response.body)
|
95
97
|
end
|
96
98
|
|
data/lib/octocheck/cli.rb
CHANGED
@@ -30,6 +30,18 @@ module Octocheck
|
|
30
30
|
end
|
31
31
|
|
32
32
|
formatter.new($stdout).format(summary)
|
33
|
+
rescue Api::NotFoundError
|
34
|
+
warn <<~TXT
|
35
|
+
Couldn't fetch info for this branch. Some things to check:
|
36
|
+
|
37
|
+
- Has it been pushed to Github?
|
38
|
+
- Does this repo have status checks enabled?
|
39
|
+
|
40
|
+
Branch:
|
41
|
+
#{summary.branch_link}
|
42
|
+
|
43
|
+
TXT
|
44
|
+
exit(1)
|
33
45
|
end
|
34
46
|
end
|
35
47
|
end
|
data/lib/octocheck/version.rb
CHANGED