escobar 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 8e5163971f30aa5f416a7e70cd5e312f918f3786
4
- data.tar.gz: 3490ec4c900b0a9817c8e3328284cbaaa1420b73
3
+ metadata.gz: deb579b46df1fc1a57b83656957c548c0644b79b
4
+ data.tar.gz: cca2acd271b856cf8362819300773b0213751d1d
5
5
  SHA512:
6
- metadata.gz: 27631e760f676bc770b0a274e2f86338cb558ae85d7d46399dd92a582b3045b9ca9649ac440a5f6cb3c8a9326c30d06fa776af697d44e3eadd9dbf0f66225328
7
- data.tar.gz: ed3e44012d6050f3b2e81e8a134a015a111bc836ede6044ab56d36fe52a5b44eba95b3f32b4439308f872aea073b6c839cf83c3a672b5d29a3472eaf97694f8c
6
+ metadata.gz: d98fa606881aec71fd8c6cb1f755fb749a562dff5a6f33ab726f2096a1d8114773bbec02573a30d6e4bfb3e4728c937f3dd55435a9e995822e57600019843e52
7
+ data.tar.gz: 67fe03bc3a4102011e3041cb8f8a3ea81bc1cdf299469e004b082b14c62592787a1ca49b48ca58d3e7e8eb230056b1f69c559809079af79567b6224e84708c60
@@ -17,6 +17,14 @@ module Escobar
17
17
  end
18
18
  end
19
19
 
20
+ def repository
21
+ @repository ||= get("/pipelines/#{id}/repository")
22
+ end
23
+
24
+ def github_repository
25
+ repository["repository"] && repository["repository"]["name"]
26
+ end
27
+
20
28
  def couplings
21
29
  @couplings ||= couplings!
22
30
  end
@@ -26,6 +34,20 @@ module Escobar
26
34
  Escobar::Heroku::Coupling.new(client, coupling)
27
35
  end
28
36
  end
37
+
38
+ def get(path)
39
+ response = kolkrabbi.get do |request|
40
+ request.url path
41
+ request.headers["Content-Type"] = "application/json"
42
+ request.headers["Authorization"] = "Bearer #{client.token}"
43
+ end
44
+
45
+ JSON.parse(response.body)
46
+ end
47
+
48
+ def kolkrabbi
49
+ @kolkrabbi ||= Faraday.new(url: "https://#{ENV['KOLKRABBI_HOSTNAME']}")
50
+ end
29
51
  end
30
52
  end
31
53
  end
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe