johac 0.9.3 → 0.9.4
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 +4 -4
- data/lib/johac/client.rb +3 -1
- data/lib/johac/response.rb +1 -5
- data/lib/johac/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: e4b63bbad484ffbde7f5f70624dcfe64c24537e5
|
|
4
|
+
data.tar.gz: 753395644624c95a93e89014df5514e0e761ab21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4984ad31332f7272890794c5ec2c74b884ce48feae9e40086e2ef025abef2405f389fd788d1346aedca0e7a636a8a11ad5881eeb91cb8b3bc72538753879172a
|
|
7
|
+
data.tar.gz: 890b6f038b08e759331b026aaf53341819056efd49acfaba2834158d9ad6e8653f550df0b94ba66bd6465c34f25bb40e03d41cc1597c92712c8be95c37a07853
|
data/lib/johac/client.rb
CHANGED
|
@@ -43,7 +43,9 @@ module Johac
|
|
|
43
43
|
capture(&block).map { |env|
|
|
44
44
|
output = []
|
|
45
45
|
output << "curl -s -X#{env.method.to_s.upcase}"
|
|
46
|
-
env.request_headers.
|
|
46
|
+
env.request_headers.select { |name, value|
|
|
47
|
+
name.downcase != 'user-agent'
|
|
48
|
+
}.each { |name, value|
|
|
47
49
|
output << "-H'#{name}: #{value}'"
|
|
48
50
|
}
|
|
49
51
|
output << "'#{env.url}'"
|
data/lib/johac/response.rb
CHANGED
|
@@ -31,11 +31,7 @@ module Johac
|
|
|
31
31
|
|
|
32
32
|
# @return OpenStruct object of hash, or empty struct if error
|
|
33
33
|
def object
|
|
34
|
-
|
|
35
|
-
OpenStruct.new(body)
|
|
36
|
-
else
|
|
37
|
-
OpenStruct.new
|
|
38
|
-
end
|
|
34
|
+
error? ? OpenStruct.new : OpenStruct.new(body)
|
|
39
35
|
end
|
|
40
36
|
|
|
41
37
|
# Map response body if successful
|
data/lib/johac/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: johac
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dan Simpson
|
|
@@ -146,7 +146,7 @@ dependencies:
|
|
|
146
146
|
- - ">="
|
|
147
147
|
- !ruby/object:Gem::Version
|
|
148
148
|
version: 4.7.5
|
|
149
|
-
description: Opintionated library for
|
|
149
|
+
description: Opintionated library for implementing HTTP+JSON API clients
|
|
150
150
|
email: dan.simpson@gmail.com
|
|
151
151
|
executables: []
|
|
152
152
|
extensions: []
|