glimr-api-client 0.2.2 → 0.2.3

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: 832a835ff5881c0dfe45bb170e756807a37dab64
4
- data.tar.gz: 3c599607615e05c67cc75b1c527dee76d3dc07e2
3
+ metadata.gz: f2a465b55c349f163e7ed0c3a1c1615e79f81cd4
4
+ data.tar.gz: 946d139aa937ee74cb839b751a45d36d0fb11328
5
5
  SHA512:
6
- metadata.gz: 1658d7fa8a16e6ca6f837f988f0bccff4c5ea4e51866c3ef44e6be215526e5830310847437e0d28744b8dd47e400ebca337ad2119389ff6c84c4264eab924fee
7
- data.tar.gz: 71df9335732a170e1e224682c9a9d35346c2d78e2c30ae49da62621c322d8c160e23c8dab461bc1f39c35afe5d4a82b2bcc83288bf6b0063a9fc7c27297a50c4
6
+ metadata.gz: 22dd47ac86558090a6110a34d12a83e5fde8bfcb683d4a2bd1b667bf7645ae7461a77ee03792def2adcec3669ea7be2277e88d17cb71bc783f55ab101bc2f163
7
+ data.tar.gz: bd3f2a0deaa3702e5481a666b927d4ca0e887f5999760016aa0065fcae10ed41097874dc0f60202c46131da2a2cffc661e1e788e55782335b759251c14cb5b4f
@@ -2,9 +2,17 @@ require 'excon'
2
2
 
3
3
  module GlimrApiClient
4
4
  module Api
5
+ # Showing the GLiMR post & response in the container logs is helpful
6
+ # for troubleshooting in the staging environment (when we are using
7
+ # the websocket link to communicate with a GLiMR instance to which
8
+ # we have very limited access.
9
+ # DO NOT SET THIS ENV VAR IN PRODUCTION - we should not be logging
10
+ # this sensitive user data from the live service.
5
11
  def post
12
+ puts "GLIMR POST: #{request_body.to_json}" if ENV.key?('GLIMR_API_DEBUG')
6
13
  client("#{api_url}#{endpoint}").post(body: request_body.to_json).tap { |resp|
7
14
  handle_response_errors(resp) if (400..599).cover?(resp.status)
15
+ puts "GLIMR RESPONSE: #{resp.body}" if ENV.key?('GLIMR_API_DEBUG')
8
16
  @body = resp.body
9
17
  }
10
18
  rescue Excon::Error => e
@@ -15,7 +23,7 @@ module GlimrApiClient
15
23
  @response_body ||= JSON.parse(@body, symbolize_names: true)
16
24
  end
17
25
 
18
- def timeout
26
+ def timeout
19
27
  Integer(ENV.fetch('GLIMR_API_TIMEOUT_SECONDS', 5))
20
28
  end
21
29
 
@@ -54,7 +62,7 @@ module GlimrApiClient
54
62
  'Accept' => 'application/json'
55
63
  },
56
64
  persistent: true,
57
- read_timeout: timeout
65
+ read_timeout: timeout
58
66
  )
59
67
  end
60
68
  end
@@ -1,3 +1,3 @@
1
1
  module GlimrApiClient
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimr-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Tyree
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler