asin 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5afa79d2292ab370f7b23c23c77478aec60e774
4
- data.tar.gz: 6ec3e8c4d1f0655f352306e588b820a9311d5703
3
+ metadata.gz: 5d24c856333d2ff7d131765947bd4d4abe8f1451
4
+ data.tar.gz: 2aa29f96ed6ec63316f37bfc8af91b4da330a498
5
5
  SHA512:
6
- metadata.gz: 56af1187bc103b98ae66f46eb45cc8b369b10f423fc0967e8136b961ac48cbbc6dbbfc3d88d91acf6167cfbaf894bcccb03e52d594a1c1e3593e7519ebe44eb4
7
- data.tar.gz: 6e187cd6425784758c75169e8c0e147f5e048d4698eca5f2e56a94930f801296c34e64a0da5c01cc4564365256b2ca6f6821f5aa1c5081e156cf2182ac55725c
6
+ metadata.gz: b0ba427f9ae87eecbba63fc1ce18c783e246b0796fb2b4e73e1d173636c059f5ce569f82b7635937d24f867ce2cf9fdb25a3e8007aec6f43f694ee1fd7f7aa9b
7
+ data.tar.gz: 2df98bbd2428438fdd2c5179bd700de5aff4d98d7e3a15ab8746db2b7e0266d3e8142fb0ba493890a74ab6703c4387c4139c133b4aec4c0ec56757eb720c823a
@@ -1,5 +1,7 @@
1
+ sudo: false
1
2
  script: "CODECLIMATE_REPO_TOKEN=eb04e2a7fa1767ae9055bcb6d74aee731b3ada7eff6dad170cedadca3d649fb7 bundle exec rake"
2
3
  rvm:
3
4
  - 2.0.0
4
5
  - 2.1.0
5
- - jruby-19mode
6
+ - 2.2.0
7
+ - 2.3.0
@@ -1,3 +1,7 @@
1
+ ## 2.0.2
2
+
3
+ * changes from Hashie::Rash to Hashie::SCHash, because Hashie added its own Rash class that conflicted with the Rash gem.
4
+
1
5
  ## 2.0.1
2
6
 
3
7
  * get rid of OpenSSL deprecation (davelacy) https://github.com/phoet/asin/pull/36
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :development do
6
- gem 'pry-plus', platforms: :ruby
6
+ gem 'byebug', platforms: :ruby
7
7
  end
8
8
 
9
9
  group :test do
@@ -1,77 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- asin (2.0.0)
4
+ asin (2.0.2)
5
5
  confiture (>= 0.1)
6
6
  crack (>= 0.3)
7
7
  hashie (>= 1.1)
8
8
  httpi (>= 0.9)
9
- rash (>= 0.4)
9
+ snake_case_hash (>= 1.0.2)
10
10
 
11
11
  GEM
12
12
  remote: http://rubygems.org/
13
13
  specs:
14
14
  addressable (2.3.2)
15
- binding_of_caller (0.7.2)
16
- debug_inspector (>= 0.0.1)
17
- bond (0.5.1)
15
+ byebug (3.5.1)
16
+ columnize (~> 0.8)
17
+ debugger-linecache (~> 1.2)
18
+ slop (~> 3.6)
18
19
  codeclimate-test-reporter (0.3.0)
19
20
  simplecov (>= 0.7.1, < 1.0.0)
20
- coderay (1.1.0)
21
- columnize (0.3.6)
21
+ columnize (0.8.9)
22
22
  confiture (0.1.4)
23
23
  crack (0.3.1)
24
- debug_inspector (0.0.2)
25
- debugger (1.6.6)
26
- columnize (>= 0.3.1)
27
- debugger-linecache (~> 1.2.0)
28
- debugger-ruby_core_source (~> 1.3.2)
29
24
  debugger-linecache (1.2.0)
30
- debugger-ruby_core_source (1.3.2)
31
25
  diff-lcs (1.2.5)
32
26
  docile (1.1.3)
33
- hashie (2.0.5)
27
+ hashie (3.4.3)
34
28
  httpclient (2.3.0.1)
35
- httpi (2.1.0)
29
+ httpi (2.4.1)
36
30
  rack
37
- rubyntlm (~> 0.3.2)
38
- interception (0.5)
39
- jist (1.5.1)
40
- json
41
- json (1.8.1)
42
- method_source (0.8.2)
43
31
  multi_json (1.10.0)
44
- pry (0.9.12.6)
45
- coderay (~> 1.0)
46
- method_source (~> 0.8)
47
- slop (~> 3.4)
48
- pry-debugger (0.2.2)
49
- debugger (~> 1.3)
50
- pry (~> 0.9.10)
51
- pry-doc (0.6.0)
52
- pry (~> 0.9)
53
- yard (~> 0.8)
54
- pry-docmore (0.1.1)
55
- pry
56
- pry-doc
57
- pry-plus (1.0.0)
58
- bond
59
- jist
60
- pry-debugger
61
- pry-doc
62
- pry-docmore
63
- pry-rescue
64
- pry-stack_explorer
65
- pry-rescue (1.4.0)
66
- interception (>= 0.4)
67
- pry
68
- pry-stack_explorer (0.4.9.1)
69
- binding_of_caller (>= 0.7)
70
- pry (>= 0.9.11)
71
- rack (1.5.2)
32
+ rack (1.6.4)
72
33
  rake (0.9.2.2)
73
- rash (0.4.0)
74
- hashie (~> 2.0.0)
75
34
  rspec (2.14.1)
76
35
  rspec-core (~> 2.14.0)
77
36
  rspec-expectations (~> 2.14.0)
@@ -80,18 +39,18 @@ GEM
80
39
  rspec-expectations (2.14.5)
81
40
  diff-lcs (>= 1.1.3, < 2.0)
82
41
  rspec-mocks (2.14.6)
83
- rubyntlm (0.3.4)
84
42
  simplecov (0.8.2)
85
43
  docile (~> 1.1.0)
86
44
  multi_json
87
45
  simplecov-html (~> 0.8.0)
88
46
  simplecov-html (0.8.0)
89
- slop (3.5.0)
47
+ slop (3.6.0)
48
+ snake_case_hash (1.0.2)
49
+ hashie (~> 3.0)
90
50
  vcr (2.2.5)
91
51
  webmock (1.8.11)
92
52
  addressable (>= 2.2.7)
93
53
  crack (>= 0.1.7)
94
- yard (0.8.7.3)
95
54
 
96
55
  PLATFORMS
97
56
  java
@@ -99,10 +58,13 @@ PLATFORMS
99
58
 
100
59
  DEPENDENCIES
101
60
  asin!
61
+ byebug
102
62
  codeclimate-test-reporter
103
63
  httpclient (>= 2.2.3)
104
- pry-plus
105
64
  rake (~> 0.9.2)
106
65
  rspec (~> 2.11)
107
66
  vcr (~> 2.2)
108
67
  webmock (~> 1.8)
68
+
69
+ BUNDLED WITH
70
+ 1.11.2
data/README.md CHANGED
@@ -20,108 +20,121 @@ Version 2 removes all the SimpleXXX classes in favor of [Hashie::Rash](https://g
20
20
 
21
21
  The old API is available if you require `ASIN::Adapter`:
22
22
 
23
- require 'asin'
24
- require 'asin/adapter'
23
+ ```ruby
24
+ require 'asin'
25
+ require 'asin/adapter'
26
+ ```
25
27
 
26
28
  It's also a good starting point for looking into writing your own asin-adapter.
27
29
 
28
30
 
29
31
  ## Installation
30
32
 
31
- gem install asin
32
- gem install curb # optional, see HTTPI
33
+ ```bash
34
+ gem install asin
35
+ gem install curb # optional, see HTTPI
36
+ ```
33
37
 
34
38
  or in your Gemfile:
35
39
 
36
- gem 'asin'
37
- gem 'curb' # optional, see HTTPI
38
-
40
+ ```ruby
41
+ gem 'asin'
42
+ gem 'curb' # optional, see HTTPI
43
+ ```
39
44
 
40
45
  ## Configuration
41
46
 
42
47
  Rails style initializer (`config/initializers/asin.rb`):
43
48
 
44
- ASIN::Configuration.configure do |config|
45
- config.secret = 'your-secret'
46
- config.key = 'your-key'
47
- config.associate_tag = 'your-tag'
48
- end
49
+ ```ruby
50
+ ASIN::Configuration.configure do |config|
51
+ config.secret = 'your-secret'
52
+ config.key = 'your-key'
53
+ config.associate_tag = 'your-tag'
54
+ end
55
+ ```
49
56
 
50
57
  Have a look at `ASIN::Configuration` class for all the details.
51
58
 
52
-
53
59
  ## Usage
54
60
 
55
61
  ASIN is designed as a module, so you can include it into any object you like:
56
62
 
57
- # require and include
58
- require 'asin'
59
- include ASIN::Client
60
-
61
- # lookup an ASIN
62
- lookup '1430218150'
63
+ ```ruby
64
+ # require and include
65
+ require 'asin'
66
+ include ASIN::Client
63
67
 
64
- # lookup multiple items by ASIN
65
- lookup ['1430218150','1934356549']
68
+ # lookup an ASIN
69
+ lookup '1430218150'
70
+
71
+ # lookup multiple items by ASIN
72
+ lookup ['1430218150','1934356549']
73
+ ```
66
74
 
67
75
  But you can also use the *instance* method to get a proxy-object:
68
76
 
69
- # just require
70
- require 'asin'
71
-
72
- # create an ASIN client
73
- client = ASIN::Client.instance
74
-
75
- # lookup an item with the amazon standard identification number (asin)
76
- items = client.lookup '1430218150'
77
-
78
- # have a look at the title of the item
79
- items.first.item_attributes.title
80
- => Learn Objective-C on the Mac (Learn Series)
81
-
82
- # search for any kind of stuff on amazon with keywords
83
- items = search_keywords 'Learn', 'Objective-C'
84
- items.first.item_attributes.title
85
- => "Learn Objective-C on the Mac (Learn Series)"
86
-
87
- # search for any kind of stuff on amazon with custom parameters
88
- search :Keywords => 'Learn Objective-C', :SearchIndex => :Books
89
- items.first.item_attributes.title
90
- => "Learn Objective-C on the Mac (Learn Series)"
91
-
92
- # search for similar items like the one you already have
93
- items = client.similar '1430218150'
77
+ ```ruby
78
+ # just require
79
+ require 'asin'
80
+
81
+ # create an ASIN client
82
+ client = ASIN::Client.instance
83
+
84
+ # lookup an item with the amazon standard identification number (asin)
85
+ items = client.lookup '1430218150'
86
+
87
+ # have a look at the title of the item
88
+ items.first.item_attributes.title
89
+ => Learn Objective-C on the Mac (Learn Series)
90
+
91
+ # search for any kind of stuff on amazon with keywords
92
+ items = search_keywords 'Learn', 'Objective-C'
93
+ items.first.item_attributes.title
94
+ => "Learn Objective-C on the Mac (Learn Series)"
95
+
96
+ # search for any kind of stuff on amazon with custom parameters
97
+ search :Keywords => 'Learn Objective-C', :SearchIndex => :Books
98
+ items.first.item_attributes.title
99
+ => "Learn Objective-C on the Mac (Learn Series)"
100
+
101
+ # search for similar items like the one you already have
102
+ items = client.similar '1430218150'
103
+ ```
94
104
 
95
105
  There is an additional set of methods to support AWS cart operations:
96
106
 
97
- client = ASIN::Client.instance
98
-
99
- # create a cart with an item
100
- cart = client.create_cart({:asin => '1430218150', :quantity => 1})
101
- cart.cart_items.cart_item
102
- => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]
103
-
104
- # clear everything from the cart
105
- cart = client.clear_cart(cart)
106
- cart.cart_items.cart_item
107
- => []
108
-
109
- # update items in the cart
110
- cart = client.update_items(cart, {:cart_item_id => cart.items.first.CartItemId, :action => :SaveForLater}, {:cart_item_id => cart.items.first.CartItemId, :quantity => 7})
111
- cart.saved_for_later_items.saved_for_later_item
112
- => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]
107
+ ```ruby
108
+ client = ASIN::Client.instance
109
+
110
+ # create a cart with an item
111
+ cart = client.create_cart({:asin => '1430218150', :quantity => 1})
112
+ cart.cart_items.cart_item
113
+ => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]
114
+
115
+ # clear everything from the cart
116
+ cart = client.clear_cart(cart)
117
+ cart.cart_items.cart_item
118
+ => []
119
+
120
+ # update items in the cart
121
+ cart = client.update_items(cart, {:cart_item_id => cart.items.first.CartItemId, :action => :SaveForLater}, {:cart_item_id => cart.items.first.CartItemId, :quantity => 7})
122
+ cart.saved_for_later_items.saved_for_later_item
123
+ => [<#Hashie::Rash ASIN="1430218150" CartItemId="U3G241HVLLB8N6" ... >]
124
+ ```
113
125
 
114
126
  It's also possible to access browse nodes:
115
127
 
116
- client = ASIN::Client.instance
117
-
118
- # create a cart with an item
119
- node = client.browse_node('17', :ResponseGroup => :TopSellers)
120
- node.first.browse_node_id
121
- => '163357'
122
- node.first.name
123
- => 'Literature & Fiction'
128
+ ```ruby
129
+ client = ASIN::Client.instance
124
130
 
131
+ # create a cart with an item
132
+ node = client.browse_node('17', :ResponseGroup => :TopSellers)
133
+ node.first.browse_node_id
134
+ => '163357'
135
+ node.first.name
136
+ => 'Literature & Fiction'
137
+ ```
125
138
 
126
139
  ## HTTPI
127
140
 
@@ -129,8 +142,9 @@ ASIN uses [HTTPI](https://github.com/rubiii/httpi) as a HTTP-Client adapter.
129
142
  See the HTTPI documentation for how to configure different clients or the logger.
130
143
  As a default HTTPI uses _httpclient_ so you should add that dependency to your project:
131
144
 
132
- gem 'httpclient'
133
-
145
+ ```ruby
146
+ gem 'httpclient'
147
+ ```
134
148
 
135
149
  ## Confiture
136
150
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.add_dependency('crack', '>= 0.3')
21
21
  s.add_dependency('hashie', '>= 1.1')
22
- s.add_dependency('rash', '>= 0.4')
22
+ s.add_dependency('snake_case_hash', '>= 1.0.2')
23
23
  s.add_dependency('httpi', '>= 0.9')
24
24
  s.add_dependency('confiture', '>= 0.1')
25
25
 
@@ -1,8 +1,8 @@
1
1
  module ASIN
2
2
  module Adapter
3
3
  def handle_type(data, type)
4
- Hashie::Rash.new(data).tap do |rash|
5
- rash.instance_eval do
4
+ Hashie::SCHash.new(data).tap do |schash|
5
+ schash.instance_eval do
6
6
  case type
7
7
  when :cart
8
8
  def url
@@ -3,7 +3,7 @@ require 'rexml/document' # https://github.com/phoet/asin/pull/23
3
3
  require 'crack/xml'
4
4
  require 'cgi'
5
5
  require 'base64'
6
- require 'rash'
6
+ require 'sc_hash'
7
7
 
8
8
  module ASIN
9
9
  module Client
@@ -216,7 +216,7 @@ module ASIN
216
216
  end
217
217
 
218
218
  def handle_type(data, type)
219
- Hashie::Rash.new(data)
219
+ Hashie::SCHash.new(data)
220
220
  end
221
221
 
222
222
  def create_item_params(items)
@@ -1,3 +1,3 @@
1
1
  module ASIN
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -11,7 +11,6 @@ unless Net.const_defined? :HTTPSession
11
11
  class Net::HTTPSession < Net::HTTP::HTTPSession; end
12
12
  end
13
13
 
14
- require 'pry' unless defined? JRUBY_VERSION
15
14
  require 'rspec'
16
15
  require 'asin'
17
16
  require 'asin/client' # is somehow needed for jruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Schröder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-01 00:00:00.000000000 Z
11
+ date: 2016-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rash
42
+ name: snake_case_hash
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.4'
47
+ version: 1.0.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.4'
54
+ version: 1.0.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httpi
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  requirements: []
222
222
  rubyforge_project: asin
223
- rubygems_version: 2.2.2
223
+ rubygems_version: 2.5.1
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search,
@@ -253,4 +253,3 @@ test_files:
253
253
  - spec/lib/search_spec.rb
254
254
  - spec/lib/similarity_spec.rb
255
255
  - spec/spec_helper.rb
256
- has_rdoc: