octocheck 0.3.0 → 0.3.2
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: 899907062201dd5d74081caa5e1fd0f294757469d3419c59f338ff0ffed8539f
|
4
|
+
data.tar.gz: 445e9f6616c23a082c2f888000aa1501cc33429d42d8261b19ddf55d08db8db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c48f91c82bd8b3f0174e1a8bf499b21588ed873c01e574141724742991ae408d4844485c361eab1da24903350d0b80d737b322b5c1d9f10fd497fb0af52d62e
|
7
|
+
data.tar.gz: a6d2e4921e1cd0f585b8a0f0d2099855ae4cdad0e17a33d8e06f8ec7c0302285a7253910cc84949fc743dc53d945204bb8f9fe67cef733fb7ac4a81d70adc0e3
|
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