prospectus 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 6a83caa1e8c5df11f5a75a0504dd2ee30bff50b1
4
- data.tar.gz: a8f7968847301c55278e5166c83ba2ccce6d41cb
3
+ metadata.gz: 3a4d851bb14d8090f16dc6f84c3ee32482cae511
4
+ data.tar.gz: 97fc113c3a059a288e7ff59d4312512e0e25bb46
5
5
  SHA512:
6
- metadata.gz: 4335beb6154e75c29497c1926c32f21e12828f88710513e60d3be891c24707ef5b4199b4f1d3d3b02687cdc2fd55de0783e618c608f9d32d69b7b09efee2cfbf
7
- data.tar.gz: 0143bab868fe7240835782fbfb8358107cde332afcd20c639584f866bbbd586dccaf439f0af75e6a2d35619011f3e32ffd57f8a31615466616ffa00839d0d5c3
6
+ metadata.gz: e7c0ff713f400c9ac790a03771225d8429af96866e5deadda82a25d2d01ef239fe22e310ff0f5dc4c8f435475514414c4d9284b02353882cff0cdd9f1edf3ee4
7
+ data.tar.gz: e5687c1ef515fd0b35bc9c5267795b2593f097e68638f3097dcbe96763722b8d7a0ff58fe7da10e8ae19fc575bd0fb13403fb7b89a32dbeae40a0549626df51e
@@ -26,12 +26,19 @@ module LogCabin
26
26
  end
27
27
 
28
28
  def api_data
29
- @resp ||= Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
29
+ return @api_data if @api_data
30
+ resp = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
30
31
  request = Net::HTTP::Get.new uri.request_uri
31
32
  request.basic_auth(*creds)
32
33
  response = http.request(request)
33
34
  JSON.parse(response.body)
34
35
  end
36
+ @api_data = validate_response(resp)
37
+ end
38
+
39
+ def validate_response(resp)
40
+ return resp if resp.is_a? Array
41
+ fail("API lookup on gemnasium failed: #{resp['message']}")
35
42
  end
36
43
 
37
44
  def creds
@@ -2,5 +2,5 @@
2
2
  ##
3
3
  # Declare package version
4
4
  module Prospectus
5
- VERSION = '0.0.8'.freeze
5
+ VERSION = '0.0.9'.freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prospectus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-16 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary