remotr 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/remotr/respondable.rb +3 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37c4b0c5d782242eee389fa51b0a4994e2227772
4
- data.tar.gz: 8e7531229eb96f19bd8ae930c75e6969d27c2d01
3
+ metadata.gz: 9f5efcbebd596a18992884c915f5039645a510ee
4
+ data.tar.gz: c5101ae2ec484602a9ab3b7ae1a2206f950eb81d
5
5
  SHA512:
6
- metadata.gz: eb1a347376a2c2227400b2cd5ce3f0352d242e407a0781566dbab8481c1f9ff719ce4317a22a984b563f59577ca8745f82bd93f7c2b38c57c00d1751c32a544a
7
- data.tar.gz: 60301926d51b5b470bbcb1db3cf9fe070bf6de5374fb298d08ed117880003885b2e2e40fb8b8277acf97424a17c16e49129f27c373d8554bde10b8d8a14d94da
6
+ metadata.gz: a18994a149396fd08ed234d1b1c412c3ab6454cb01c5e0a31affe4688e5f1a81a22e2f0e4097e62b24d1c849a0ad51cf333a9bc3f3f718c6857775798477882f
7
+ data.tar.gz: 616c6ff39575735b1dcff80279467370d08c87000c02c764b41a68375f7cb189bb2a975365d241be331819557e3e0f8fcdb51e9765002a749b722994adc32d39
@@ -60,11 +60,10 @@ module Remotr
60
60
  def respond_with(request_operation, namespace_to_use = namespace)
61
61
  return request_operation if request_operation.failure?
62
62
  httparty_response = request_operation.object
63
-
64
- return Operations.failure(:response_missing_content_type, object: httparty_response) unless httparty_response.content_type
65
- return Operations.failure(:response_is_not_json, object: httparty_response) unless httparty_response.content_type == 'application/json'
66
63
  parsed_response = httparty_response.parsed_response
67
- return Operations.failure(:response_missing_success_flag, object: httparty_response) unless parsed_response && parsed_response.key?('success')
64
+
65
+ return Operations.failure(:response_is_not_parseable, object: httparty_response) unless parsed_response
66
+ return Operations.failure(:response_missing_success_flag, object: httparty_response) unless parsed_response && parsed_response.respond_to?(:key?) && parsed_response.key?('success')
68
67
 
69
68
  code = parsed_response['code'].to_s != '' ? parsed_response['code'].to_sym : :response_unsuccessful
70
69
  message = parsed_response['message'].to_s != '' ? parsed_response['message'] : code.to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bukowskis