vacuum 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/lib/vacuum.rb +2 -0
- data/lib/vacuum/request.rb +3 -1
- data/lib/vacuum/response.rb +3 -2
- data/lib/vacuum/version.rb +3 -1
- data/test/test_integration.rb +2 -0
- data/test/test_unit.rb +4 -2
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 42e3f3bb56b048bb30a93ed4462147f1428a30c755f69ddfde5876972e9cf746
|
4
|
+
data.tar.gz: 3b7c02497c3abcf87ab1d6ec57d3e4e8be9043722edb703155567376c3eb381b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc31524fcab82a4f7c9783fda1bb7d1308f50f1096284d5e47d3b512fa6b7efbed23b5b5250c2c5c2d7b7e75abac8763f7275e1cca1ddb2ff02557ff4a0bda09
|
7
|
+
data.tar.gz: ba77089cda43fde2b037066dc786e362971a32f4927f4b50f9fa0ec896c125e313c6e7edc767ef1ceeb7c8dc525a17f51a48abf0ec422dc20f671c567ceb8647
|
data/README.md
CHANGED
@@ -180,7 +180,7 @@ The quick and dirty way to consume a response is to parse into a Ruby hash:
|
|
180
180
|
response.to_h
|
181
181
|
```
|
182
182
|
|
183
|
-
You can also
|
183
|
+
You can also `#dig` into returned Hash:
|
184
184
|
|
185
185
|
```ruby
|
186
186
|
response.dig('ItemSearchResponse', 'Items', 'Item')
|
data/lib/vacuum.rb
CHANGED
data/lib/vacuum/request.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'jeff'
|
2
4
|
require 'vacuum/response'
|
3
5
|
|
@@ -8,7 +10,7 @@ module Vacuum
|
|
8
10
|
|
9
11
|
BadLocale = Class.new(ArgumentError)
|
10
12
|
|
11
|
-
LATEST_VERSION = '2013-08-01'
|
13
|
+
LATEST_VERSION = '2013-08-01'
|
12
14
|
|
13
15
|
HOSTS = {
|
14
16
|
'BR' => 'webservices.amazon.com.br',
|
data/lib/vacuum/response.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'delegate'
|
2
|
-
require 'dig_rb'
|
3
4
|
require 'forwardable'
|
4
5
|
require 'multi_xml'
|
5
6
|
|
@@ -29,7 +30,7 @@ module Vacuum
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def body
|
32
|
-
__getobj__.body.force_encoding(
|
33
|
+
(+__getobj__.body).force_encoding(Encoding::UTF_8)
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
data/lib/vacuum/version.rb
CHANGED
data/test/test_integration.rb
CHANGED
data/test/test_unit.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'minitest/autorun'
|
2
4
|
require_relative '../lib/vacuum'
|
3
5
|
|
@@ -47,7 +49,7 @@ class TestVacuum < Minitest::Test
|
|
47
49
|
def test_force_encodes_body
|
48
50
|
res = Object.new
|
49
51
|
def res.body
|
50
|
-
''.force_encoding(
|
52
|
+
(+'').force_encoding(Encoding::ASCII_8BIT)
|
51
53
|
end
|
52
54
|
assert_equal 'UTF-8', Response.new(res).body.encoding.name
|
53
55
|
end
|
@@ -94,7 +96,7 @@ class TestVacuum < Minitest::Test
|
|
94
96
|
Excon.stub({}, status: 403)
|
95
97
|
res = @req.item_lookup(query: {}, mock: true)
|
96
98
|
assert_equal 403, res.status
|
97
|
-
assert_raises Excon::Error do
|
99
|
+
assert_raises Excon::Error::Forbidden do
|
98
100
|
@req.item_lookup(query: {}, expects: 200, mock: true)
|
99
101
|
end
|
100
102
|
end
|
metadata
CHANGED
@@ -1,43 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vacuum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: dig_rb
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: jeff
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - "~>"
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
19
|
+
version: '2.0'
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '2.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: multi_xml
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,9 +134,9 @@ require_paths:
|
|
148
134
|
- lib
|
149
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
150
136
|
requirements:
|
151
|
-
- - "
|
137
|
+
- - ">="
|
152
138
|
- !ruby/object:Gem::Version
|
153
|
-
version: '2.
|
139
|
+
version: '2.3'
|
154
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
141
|
requirements:
|
156
142
|
- - ">="
|
@@ -158,11 +144,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
144
|
version: '0'
|
159
145
|
requirements: []
|
160
146
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.7.3
|
162
148
|
signing_key:
|
163
149
|
specification_version: 4
|
164
150
|
summary: Amazon Product Advertising in Ruby
|
165
151
|
test_files:
|
166
|
-
- test/cassettes/vacuum.yml
|
167
152
|
- test/test_integration.rb
|
153
|
+
- test/cassettes/vacuum.yml
|
168
154
|
- test/test_unit.rb
|