ravelin 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ravelin/client.rb +10 -1
- data/lib/ravelin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84d78f3e570df16a45decdfe15c5823a1304099d
|
4
|
+
data.tar.gz: 3036b14fcb3c1828de614d17f317ffabb1e9b642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 788174c69b70d4c6abe8d6b20787946863dcb7e33d4db82ae77defa2d6ae0ce22b468c919e0102148eed86713054f0e2b7d8b970a889ac1d8b8da75fc64330b6
|
7
|
+
data.tar.gz: e1eb651425d82c3e70312ae03e81bddaae75413acfc3588e5ef1abae8b0a5b2d1a7d04213c8aeca099b4e3c8bacdcf391ff60f76011e09969ecc53696a9d7ee4
|
data/lib/ravelin/client.rb
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
require 'faraday_middleware/response_middleware'
|
2
|
+
|
3
|
+
# This is a hack to compensate for Ravelin sending `null` in the response for 200's.
|
4
|
+
class FaradayMiddleware::ParseJson
|
5
|
+
define_parser do |body|
|
6
|
+
::JSON.parse(body) unless body.strip.empty? || body.strip == 'null'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
1
10
|
module Ravelin
|
2
11
|
class Client
|
3
12
|
API_BASE = 'https://api.ravelin.com'
|
@@ -36,7 +45,7 @@ module Ravelin
|
|
36
45
|
response = @connection.post(url, payload.to_json)
|
37
46
|
|
38
47
|
if response.success?
|
39
|
-
|
48
|
+
Response.new(response)
|
40
49
|
else
|
41
50
|
handle_error_response(response)
|
42
51
|
end
|
data/lib/ravelin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ravelin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Levy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-11-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|