telemetry 1.4.6 → 1.4.7

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: d5acc39552194d66600b3ea0833a5a8d56fb7fae
4
- data.tar.gz: 9ff647d1b7f37c2e0186e436175c092d4a39f974
3
+ metadata.gz: 488007c80f96a863ab6d8102b9eb2f6182ba826d
4
+ data.tar.gz: 659e8033ee00207ee035ae4f18788218e8f08e57
5
5
  SHA512:
6
- metadata.gz: f2de7f9355a711c4812921e0878c469711af6aa587d53dfac31c9fc499127c828da0e7649801884ecb73d0dc3be07f51e5181f84e9b8eb2647afab1a87539116
7
- data.tar.gz: 2f3dd14a64d3dbc2f03b308c7bb6d62ed9d2a1d26fa77a66f1924a33ab933442efa2d5f582fb8a51d56eb66fff283d543096c0fafdb646452407f41a9199f8fa
6
+ metadata.gz: d2f5f47aab4838188c526a5d985338f2555e439856992228a458d04fe9eaae4b8b75007c07fbb6b3f83cdd88983738c16df908869f0df088872f78c495c1968a
7
+ data.tar.gz: 21d7bd56904b07eda8423a40f289d15196c80fe04621a937c0477f888efd48214b52f8ec6bbc2919322c292cfbd519bea8ab968df24ff85c7b581ca18a78e61c
data/lib/telemetry/api.rb CHANGED
@@ -192,7 +192,7 @@ module Telemetry
192
192
  request['Content-Type'] = 'application/json'
193
193
  request['Accept-Version'] = '~ 1'
194
194
  request['User-Agent'] = "Telemetry Ruby Gem (#{Telemetry::TELEMETRY_VERSION})"
195
-
195
+
196
196
  start_time = Time.now
197
197
 
198
198
  begin
@@ -283,21 +283,23 @@ module Telemetry
283
283
 
284
284
  def self.parse_response(response)
285
285
  begin
286
- resp_hash = MultiJson.load(response.body)
287
- return nil unless resp_hash && (resp_hash.is_a?(Hash) || resp_hash.is_a?(Array))
286
+ resp_json = MultiJson.load(response.body)
287
+ return nil unless resp_json && (resp_json.is_a?(Hash) || resp_json.is_a?(Array))
288
288
 
289
- if resp_hash["errors"] && resp_hash["errors"].is_a?(Array) && resp_hash["errors"].count > 0
290
- Telemetry::logger.error "Errors: #{resp_hash['errors'].join(', ')}"
291
- end
289
+ if resp_json.is_a?(Hash)
290
+ if resp_json["errors"] && resp_json["errors"].is_a?(Array) && resp_json["errors"].count > 0
291
+ Telemetry::logger.error "Errors: #{resp_json['errors'].join(', ')}"
292
+ end
292
293
 
293
- if resp_hash["updated"] && resp_hash["updated"].is_a?(Array) && resp_hash["updated"].count > 0
294
- Telemetry::logger.debug "Updated: #{resp_hash['updated'].join(', ')}"
295
- end
294
+ if resp_json["updated"] && resp_json["updated"].is_a?(Array) && resp_json["updated"].count > 0
295
+ Telemetry::logger.debug "Updated: #{resp_json['updated'].join(', ')}"
296
+ end
296
297
 
297
- if resp_hash["skipped"] && resp_hash["skipped"].is_a?(Array) && resp_hash["skipped"].count > 0
298
- Telemetry::logger.error "Skipped: #{resp_hash['skipped'].join(', ')}"
299
- end
300
- return resp_hash
298
+ if resp_json["skipped"] && resp_json["skipped"].is_a?(Array) && resp_json["skipped"].count > 0
299
+ Telemetry::logger.error "Skipped: #{resp_json['skipped'].join(', ')}"
300
+ end
301
+ end
302
+ return resp_json
301
303
 
302
304
  rescue Exception => e
303
305
  return nil
@@ -314,7 +316,7 @@ module Telemetry
314
316
 
315
317
  class AuthorizationError < Exception
316
318
  end
317
-
319
+
318
320
  class FlowNotFound < Exception
319
321
  end
320
322
 
@@ -1,3 +1,3 @@
1
1
  module Telemetry
2
- TELEMETRY_VERSION = "1.4.6"
2
+ TELEMETRY_VERSION = "1.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telemetry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - W. Gersham Meharg