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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53ba0e2df80c00110a3c923f44d945fa0388216e1e8020134b1a16eb673cba83
4
- data.tar.gz: 9062e3fa8a8082bc8d5f225c0ca64899b9d7894dc9a039dd8126f90351f97e95
3
+ metadata.gz: 10f7d809cad3d2620ae32a0f321618789509d1b9a77b4ca2f2985bfa4d269843
4
+ data.tar.gz: d74d3d00e7f91649f2229561b82c3a49e9b7e61497e20ac3e7e55685a1c1f632
5
5
  SHA512:
6
- metadata.gz: d29ec815332501e52ddef340da476943c2620ff9d384d5a624de8c0a80e384a67cdc5407f8f29351e8eb712a65494c4151db148de29295479a081a3c3c08a43c
7
- data.tar.gz: d9f457ad664cd5e6af6dae036d195abc1039799d3a0a9127630911a347093658330af8b2d4e0dde86463da7f6799a1a3ef933de7569de156219dc11a4ca3b474
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
@@ -1,3 +1,3 @@
1
1
  module Octocheck
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom