octocheck 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53ba0e2df80c00110a3c923f44d945fa0388216e1e8020134b1a16eb673cba83
4
- data.tar.gz: 9062e3fa8a8082bc8d5f225c0ca64899b9d7894dc9a039dd8126f90351f97e95
3
+ metadata.gz: 899907062201dd5d74081caa5e1fd0f294757469d3419c59f338ff0ffed8539f
4
+ data.tar.gz: 445e9f6616c23a082c2f888000aa1501cc33429d42d8261b19ddf55d08db8db0
5
5
  SHA512:
6
- metadata.gz: d29ec815332501e52ddef340da476943c2620ff9d384d5a624de8c0a80e384a67cdc5407f8f29351e8eb712a65494c4151db148de29295479a081a3c3c08a43c
7
- data.tar.gz: d9f457ad664cd5e6af6dae036d195abc1039799d3a0a9127630911a347093658330af8b2d4e0dde86463da7f6799a1a3ef933de7569de156219dc11a4ca3b474
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
@@ -1,3 +1,3 @@
1
1
  module Octocheck
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octocheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom