amazon-associates 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -2
- data/VERSION.yml +3 -3
- data/amazon-associates.gemspec +59 -78
- data/lib/amazon-associates/request.rb +4 -6
- data/lib/amazon-associates/types/browse_node.rb +2 -2
- data/spec/requests/browse_node_lookup_spec.rb +27 -29
- data/spec/requests/item_search_spec.rb +17 -19
- data/spec/requests/support_spec.rb +13 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/types/cart_spec.rb +15 -15
- data/spec/types/item_spec.rb +1 -1
- metadata +77 -92
data/Rakefile
CHANGED
@@ -8,10 +8,9 @@ Jeweler::Tasks.new do |s|
|
|
8
8
|
s.homepage = "http://github.com/Empact/amazon-associates"
|
9
9
|
s.description = "amazon-associates offers object-oriented access to the Amazon Associates API, built on ROXML"
|
10
10
|
s.authors = ["Ben Woosley", "Dan Pickett", "Herryanto Siatono"]
|
11
|
-
s.add_runtime_dependency("roxml", ">= 3.
|
11
|
+
s.add_runtime_dependency("roxml", ">= 3.2.0")
|
12
12
|
s.add_runtime_dependency("activemodel", ">= 3.0.0")
|
13
13
|
s.add_runtime_dependency("activesupport", ">= 2.3.4")
|
14
|
-
s.add_runtime_dependency("ruby-hmac")
|
15
14
|
s.add_runtime_dependency("will_paginate")
|
16
15
|
s.add_development_dependency("thoughtbot-shoulda")
|
17
16
|
s.add_development_dependency("mocha")
|
data/VERSION.yml
CHANGED
data/amazon-associates.gemspec
CHANGED
@@ -1,120 +1,101 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{amazon-associates}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{
|
11
|
+
s.authors = [%q{Ben Woosley}, %q{Dan Pickett}, %q{Herryanto Siatono}]
|
12
|
+
s.date = %q{2011-11-25}
|
13
13
|
s.description = %q{amazon-associates offers object-oriented access to the Amazon Associates API, built on ROXML}
|
14
14
|
s.email = %q{ben.woosley@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
20
|
+
"CHANGELOG",
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION.yml",
|
25
|
+
"amazon-associates.gemspec",
|
26
|
+
"lib/amazon-associates.rb",
|
27
|
+
"lib/amazon-associates/caching/filesystem_cache.rb",
|
28
|
+
"lib/amazon-associates/errors.rb",
|
29
|
+
"lib/amazon-associates/extensions/core.rb",
|
30
|
+
"lib/amazon-associates/extensions/hpricot.rb",
|
31
|
+
"lib/amazon-associates/request.rb",
|
32
|
+
"lib/amazon-associates/requests/browse_node.rb",
|
33
|
+
"lib/amazon-associates/requests/cart.rb",
|
34
|
+
"lib/amazon-associates/requests/item.rb",
|
35
|
+
"lib/amazon-associates/responses/browse_node_lookup_response.rb",
|
36
|
+
"lib/amazon-associates/responses/cart_responses.rb",
|
37
|
+
"lib/amazon-associates/responses/item_lookup_response.rb",
|
38
|
+
"lib/amazon-associates/responses/item_search_response.rb",
|
39
|
+
"lib/amazon-associates/responses/response.rb",
|
40
|
+
"lib/amazon-associates/responses/similarity_lookup_response.rb",
|
41
|
+
"lib/amazon-associates/types/api_result.rb",
|
42
|
+
"lib/amazon-associates/types/browse_node.rb",
|
43
|
+
"lib/amazon-associates/types/cart.rb",
|
44
|
+
"lib/amazon-associates/types/customer_review.rb",
|
45
|
+
"lib/amazon-associates/types/editorial_review.rb",
|
46
|
+
"lib/amazon-associates/types/error.rb",
|
47
|
+
"lib/amazon-associates/types/image.rb",
|
48
|
+
"lib/amazon-associates/types/image_set.rb",
|
49
|
+
"lib/amazon-associates/types/item.rb",
|
50
|
+
"lib/amazon-associates/types/listmania_list.rb",
|
51
|
+
"lib/amazon-associates/types/measurement.rb",
|
52
|
+
"lib/amazon-associates/types/offer.rb",
|
53
|
+
"lib/amazon-associates/types/ordinal.rb",
|
54
|
+
"lib/amazon-associates/types/price.rb",
|
55
|
+
"lib/amazon-associates/types/requests.rb",
|
56
|
+
"spec/requests/browse_node_lookup_spec.rb",
|
57
|
+
"spec/requests/item_search_spec.rb",
|
58
|
+
"spec/requests/support_spec.rb",
|
59
|
+
"spec/spec_helper.rb",
|
60
|
+
"spec/types/cart_spec.rb",
|
61
|
+
"spec/types/item_spec.rb",
|
62
|
+
"spec/types/measurement_spec.rb",
|
63
|
+
"test/amazon/browse_node_test.rb",
|
64
|
+
"test/amazon/cache_test.rb",
|
65
|
+
"test/amazon/caching/filesystem_cache_test.rb",
|
66
|
+
"test/amazon/item_test.rb",
|
67
|
+
"test/test_helper.rb",
|
68
|
+
"test/utilities/filesystem_test_helper.rb"
|
69
69
|
]
|
70
70
|
s.homepage = %q{http://github.com/Empact/amazon-associates}
|
71
|
-
s.
|
72
|
-
s.
|
73
|
-
s.rubygems_version = %q{1.3.7}
|
71
|
+
s.require_paths = [%q{lib}]
|
72
|
+
s.rubygems_version = %q{1.8.8}
|
74
73
|
s.summary = %q{Generic Amazon Associates Web Service (Formerly ECS) REST API. Supports ECS 4.0.}
|
75
|
-
s.test_files = [
|
76
|
-
"spec/requests/browse_node_lookup_spec.rb",
|
77
|
-
"spec/requests/item_search_spec.rb",
|
78
|
-
"spec/spec_helper.rb",
|
79
|
-
"spec/types/cart_spec.rb",
|
80
|
-
"spec/types/item_spec.rb",
|
81
|
-
"spec/types/measurement_spec.rb",
|
82
|
-
"test/amazon/browse_node_test.rb",
|
83
|
-
"test/amazon/cache_test.rb",
|
84
|
-
"test/amazon/caching/filesystem_cache_test.rb",
|
85
|
-
"test/amazon/item_test.rb",
|
86
|
-
"test/test_helper.rb",
|
87
|
-
"test/utilities/filesystem_test_helper.rb"
|
88
|
-
]
|
89
74
|
|
90
75
|
if s.respond_to? :specification_version then
|
91
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
92
76
|
s.specification_version = 3
|
93
77
|
|
94
78
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
95
|
-
s.add_runtime_dependency(%q<roxml>, [">= 3.
|
79
|
+
s.add_runtime_dependency(%q<roxml>, [">= 3.2.0"])
|
96
80
|
s.add_runtime_dependency(%q<activemodel>, [">= 3.0.0"])
|
97
81
|
s.add_runtime_dependency(%q<activesupport>, [">= 2.3.4"])
|
98
|
-
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0"])
|
99
82
|
s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
|
100
83
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
101
84
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
102
85
|
s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
|
103
86
|
else
|
104
|
-
s.add_dependency(%q<roxml>, [">= 3.
|
87
|
+
s.add_dependency(%q<roxml>, [">= 3.2.0"])
|
105
88
|
s.add_dependency(%q<activemodel>, [">= 3.0.0"])
|
106
89
|
s.add_dependency(%q<activesupport>, [">= 2.3.4"])
|
107
|
-
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
108
90
|
s.add_dependency(%q<will_paginate>, [">= 0"])
|
109
91
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
110
92
|
s.add_dependency(%q<mocha>, [">= 0"])
|
111
93
|
s.add_dependency(%q<rspec>, [">= 2.0.0"])
|
112
94
|
end
|
113
95
|
else
|
114
|
-
s.add_dependency(%q<roxml>, [">= 3.
|
96
|
+
s.add_dependency(%q<roxml>, [">= 3.2.0"])
|
115
97
|
s.add_dependency(%q<activemodel>, [">= 3.0.0"])
|
116
98
|
s.add_dependency(%q<activesupport>, [">= 2.3.4"])
|
117
|
-
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
118
99
|
s.add_dependency(%q<will_paginate>, [">= 0"])
|
119
100
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
120
101
|
s.add_dependency(%q<mocha>, [">= 0"])
|
@@ -6,8 +6,6 @@ end
|
|
6
6
|
|
7
7
|
require 'net/http'
|
8
8
|
require 'cgi'
|
9
|
-
require 'hmac'
|
10
|
-
require 'hmac-sha2'
|
11
9
|
require 'base64'
|
12
10
|
|
13
11
|
module Amazon
|
@@ -91,6 +89,7 @@ module Amazon
|
|
91
89
|
BASE_ARGS + VALID_ARGS.fetch(operation, OTHER_ARGS)
|
92
90
|
end
|
93
91
|
|
92
|
+
HMAC_DIGEST = OpenSSL::Digest::Digest.new('sha256')
|
94
93
|
TLDS = HashWithIndifferentAccess.new(
|
95
94
|
'us' => 'com',
|
96
95
|
'uk' => 'co.uk',
|
@@ -122,10 +121,9 @@ module Amazon
|
|
122
121
|
'SignatureMethod' => "HmacSHA256"
|
123
122
|
)
|
124
123
|
|
125
|
-
unsigned_uri = URI.parse("http://ecs.amazonaws.#{tld(opts.delete(
|
126
|
-
hmac = HMAC
|
127
|
-
|
128
|
-
"#{unsigned_uri}&Signature=#{CGI::escape(Base64.encode64(hmac.digest).chomp)}"
|
124
|
+
unsigned_uri = URI.parse("http://ecs.amazonaws.#{tld(opts.delete(:country))}/onca/xml?#{params.sort { |a, b| a[0] <=> b[0] }.map { |key, val| "#{key}=#{CGI::escape(val).gsub('+', '%20')}" }.join("&")}")
|
125
|
+
hmac = OpenSSL::HMAC.digest(HMAC_DIGEST, ENV['AMAZON_SECRET_ACCESS_KEY'], "GET\n#{unsigned_uri.host}\n#{unsigned_uri.path}\n#{unsigned_uri.query}")
|
126
|
+
"#{unsigned_uri}&Signature=#{CGI::escape(Base64.encode64(hmac).chomp)}"
|
129
127
|
end
|
130
128
|
|
131
129
|
def self.cacheable?(operation)
|
@@ -11,8 +11,8 @@ module Amazon
|
|
11
11
|
xml_reader :children, :as => [BrowseNode]
|
12
12
|
xml_reader :top_sellers, :as => [Item]
|
13
13
|
|
14
|
-
def self.find(browse_node_id, opts = {}
|
15
|
-
Amazon::Associates.browse_node_lookup(opts.merge(:browse_node_id => browse_node_id)
|
14
|
+
def self.find(browse_node_id, opts = {})
|
15
|
+
Amazon::Associates.browse_node_lookup(opts.merge(:browse_node_id => browse_node_id)).browse_nodes.first
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize(id = nil, name = nil, parent = nil)
|
@@ -1,40 +1,38 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
it_should_behave_like "Amazon Associates response"
|
3
|
+
describe Amazon::Associates do
|
4
|
+
describe ".browse_node_lookup" do
|
5
|
+
context "with 'TopSellers' response group" do
|
6
|
+
before(:all) do
|
7
|
+
@response = Amazon::Associates.browse_node_lookup("5", :response_group => "TopSellers")
|
8
|
+
end
|
9
|
+
it_should_behave_like "Amazon Associates response"
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
11
|
+
it "should work" do
|
12
|
+
@response.browse_nodes.first.id.should == '5'
|
13
|
+
@response.request_query.response_groups.first.should == "TopSellers"
|
16
14
|
end
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
context "with 'BrowseNodeInfo' response group" do
|
18
|
+
before(:all) do
|
19
|
+
@response = Amazon::Associates.browse_node_lookup("5", :response_group => "BrowseNodeInfo")
|
20
|
+
end
|
21
|
+
it_should_behave_like "Amazon Associates response"
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
end
|
23
|
+
it "should work" do
|
24
|
+
@response.request_query.response_groups.first.should == "BrowseNodeInfo"
|
27
25
|
end
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
context "with 'NewReleases' response group" do
|
29
|
+
before(:all) do
|
30
|
+
@response = Amazon::Associates.browse_node_lookup("5", :response_group => "NewReleases")
|
31
|
+
end
|
32
|
+
it_should_behave_like "Amazon Associates response"
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
end
|
34
|
+
it "should work" do
|
35
|
+
@response.request_query.response_groups.first.should == "NewReleases"
|
38
36
|
end
|
39
37
|
end
|
40
38
|
end
|
@@ -1,27 +1,25 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
proc { Amazon::Associates.item_search(nil) }.should raise_error(Amazon::Associates::RequiredParameterMissing)
|
9
|
-
end
|
3
|
+
describe Amazon::Associates do
|
4
|
+
describe ".item_search" do
|
5
|
+
context "when omitting required parameters" do
|
6
|
+
it "should fail" do
|
7
|
+
proc { Amazon::Associates.item_search(nil) }.should raise_error(Amazon::Associates::RequiredParameterMissing)
|
10
8
|
end
|
9
|
+
end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
end
|
11
|
+
context "when the country is not recognized" do
|
12
|
+
it "should fail" do
|
13
|
+
proc { Amazon::Associates.item_search('ruby', :country => :asfdkjjk) }.should raise_error(Amazon::Associates::RequestError)
|
16
14
|
end
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
-
|
23
|
-
it_should_behave_like "Amazon Associates response"
|
17
|
+
context "on valid request" do
|
18
|
+
before(:all) do
|
19
|
+
@response = Amazon::Associates.item_search("ruby", :item_page => 2)
|
24
20
|
end
|
21
|
+
|
22
|
+
it_should_behave_like "Amazon Associates response"
|
25
23
|
end
|
26
24
|
end
|
27
|
-
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Amazon::Associates do
|
4
|
+
describe ".prepare_url" do
|
5
|
+
context "when a country is provided" do
|
6
|
+
it "should adjust the top-level domain of the result" do
|
7
|
+
Amazon::Associates::TLDS.each_pair do |country, tld|
|
8
|
+
Amazon::Associates.send(:prepare_url, country: country).should =~ %r{http://ecs\.amazonaws\.#{tld}/onca/xml\?.+}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "../lib/amazon-associates")
|
2
2
|
|
3
|
+
Amazon::Associates.options.merge!(
|
4
|
+
associate_tag: ENV['AMAZON_ASSOCIATE_TAG'], aws_access_key_id: ENV['AMAZON_ACCESS_KEY_ID'])
|
5
|
+
|
3
6
|
shared_examples_for "Amazon Associates response" do
|
4
7
|
describe "request" do
|
5
8
|
subject { @response.request }
|
data/spec/types/cart_spec.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
module Amazon
|
4
4
|
module Associates
|
5
5
|
describe Cart do
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
@potter = Amazon::Associates::item_lookup("0545010225").item
|
8
8
|
@batman = Amazon::Associates::item_search("batman").items.first
|
9
9
|
@joker = Amazon::Associates::item_search("joker").items.first
|
@@ -51,7 +51,7 @@ module Amazon
|
|
51
51
|
|
52
52
|
describe ".create" do
|
53
53
|
context "items passed in hash form" do
|
54
|
-
before
|
54
|
+
before do
|
55
55
|
@cart = Cart.create(@potter => 1, @batman => 3)
|
56
56
|
end
|
57
57
|
|
@@ -64,7 +64,7 @@ module Amazon
|
|
64
64
|
|
65
65
|
context "items passed in array form" do
|
66
66
|
context "with actual items" do
|
67
|
-
before
|
67
|
+
before do
|
68
68
|
@cart = Cart.create([@potter, @batman])
|
69
69
|
end
|
70
70
|
|
@@ -77,7 +77,7 @@ module Amazon
|
|
77
77
|
end
|
78
78
|
|
79
79
|
context "with hashes containing item asins" do
|
80
|
-
before
|
80
|
+
before do
|
81
81
|
@items = { { :asin => "0974514055" } => 2, { :asin => "0672328844" } => 3 }
|
82
82
|
@cart = Cart.create(@items)
|
83
83
|
end
|
@@ -96,7 +96,7 @@ module Amazon
|
|
96
96
|
end
|
97
97
|
|
98
98
|
context "with hashes containing offer_listing_ids" do
|
99
|
-
before
|
99
|
+
before do
|
100
100
|
@items = { { :offer_listing_id => "MCK%2FnCXIges8tpX%2B222nOYEqeZ4AzbrFyiHuP6pFf45N3vZHTm8hFTytRF%2FLRONNkVmt182%2BmeX72n%2BbtUcGEtpLN92Oy9Y7"} => 2 }
|
101
101
|
@cart = Cart.create(@items)
|
102
102
|
end
|
@@ -134,7 +134,7 @@ module Amazon
|
|
134
134
|
end
|
135
135
|
|
136
136
|
context "with an existing cart" do
|
137
|
-
before
|
137
|
+
before do
|
138
138
|
@cart = Cart.get(@existing_cart)
|
139
139
|
end
|
140
140
|
|
@@ -142,7 +142,7 @@ module Amazon
|
|
142
142
|
end
|
143
143
|
|
144
144
|
context "with an id and hmac" do
|
145
|
-
before
|
145
|
+
before do
|
146
146
|
@cart = Cart.get(:id => @existing_cart.id, :hmac => @existing_cart.hmac)
|
147
147
|
end
|
148
148
|
|
@@ -167,7 +167,7 @@ module Amazon
|
|
167
167
|
|
168
168
|
describe "#add" do
|
169
169
|
context "adding a new item, on save" do
|
170
|
-
before
|
170
|
+
before do
|
171
171
|
@number_added = 3
|
172
172
|
@item_added = @joker
|
173
173
|
@existing_cart.should_not include(@item_added)
|
@@ -185,7 +185,7 @@ module Amazon
|
|
185
185
|
end
|
186
186
|
|
187
187
|
context "on save" do
|
188
|
-
before
|
188
|
+
before do
|
189
189
|
@existing_cart.should have(2).items
|
190
190
|
lambda { @existing_cart.save }.should change(@existing_cart, :quantity).by(@number_added)
|
191
191
|
@existing_cart.should have(3).items
|
@@ -214,7 +214,7 @@ module Amazon
|
|
214
214
|
end
|
215
215
|
|
216
216
|
context "on save" do
|
217
|
-
before
|
217
|
+
before do
|
218
218
|
lambda { @existing_cart.save }.should change {
|
219
219
|
@existing_cart.items.find {|item| item == @item_added }.quantity }.by(@number_added)
|
220
220
|
|
@@ -231,7 +231,7 @@ module Amazon
|
|
231
231
|
end
|
232
232
|
|
233
233
|
context "adding an existing item, on save, via add" do
|
234
|
-
before
|
234
|
+
before do
|
235
235
|
@number_added = 2
|
236
236
|
@item_added = @existing_items.first
|
237
237
|
@cart = @existing_cart
|
@@ -242,7 +242,7 @@ module Amazon
|
|
242
242
|
end
|
243
243
|
|
244
244
|
context "adding an existing item, on save, via add" do
|
245
|
-
before
|
245
|
+
before do
|
246
246
|
@number_added = 1
|
247
247
|
@item_added = @existing_items.first
|
248
248
|
@cart = @existing_cart
|
@@ -254,7 +254,7 @@ module Amazon
|
|
254
254
|
end
|
255
255
|
|
256
256
|
describe "#clear" do
|
257
|
-
before
|
257
|
+
before do
|
258
258
|
@existing_quantity = @existing_cart.quantity
|
259
259
|
@existing_quantity.should == 4
|
260
260
|
@existing_cart.empty?.should be_false
|
@@ -272,7 +272,7 @@ module Amazon
|
|
272
272
|
end
|
273
273
|
|
274
274
|
context "after #save" do
|
275
|
-
before
|
275
|
+
before do
|
276
276
|
@cart.should have(2).items
|
277
277
|
|
278
278
|
lambda { @cart.save }.should change {
|
data/spec/types/item_spec.rb
CHANGED
metadata
CHANGED
@@ -1,117 +1,104 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazon-associates
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.2
|
4
5
|
prerelease:
|
5
|
-
version: 0.7.1
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Ben Woosley
|
9
9
|
- Dan Pickett
|
10
10
|
- Herryanto Siatono
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2011-11-25 00:00:00.000000000Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
18
17
|
name: roxml
|
19
|
-
|
20
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
requirement: &2164972660 !ruby/object:Gem::Requirement
|
21
19
|
none: false
|
22
|
-
requirements:
|
23
|
-
- -
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 3.
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.2.0
|
26
24
|
type: :runtime
|
27
|
-
version_requirements: *id001
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: activemodel
|
30
25
|
prerelease: false
|
31
|
-
|
26
|
+
version_requirements: *2164972660
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activemodel
|
29
|
+
requirement: &2164962200 !ruby/object:Gem::Requirement
|
32
30
|
none: false
|
33
|
-
requirements:
|
34
|
-
- -
|
35
|
-
- !ruby/object:Gem::Version
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
36
34
|
version: 3.0.0
|
37
35
|
type: :runtime
|
38
|
-
version_requirements: *id002
|
39
|
-
- !ruby/object:Gem::Dependency
|
40
|
-
name: activesupport
|
41
36
|
prerelease: false
|
42
|
-
|
37
|
+
version_requirements: *2164962200
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: activesupport
|
40
|
+
requirement: &2164957120 !ruby/object:Gem::Requirement
|
43
41
|
none: false
|
44
|
-
requirements:
|
45
|
-
- -
|
46
|
-
- !ruby/object:Gem::Version
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
47
45
|
version: 2.3.4
|
48
46
|
type: :runtime
|
49
|
-
version_requirements: *id003
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: ruby-hmac
|
52
47
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
requirements:
|
56
|
-
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version: "0"
|
59
|
-
type: :runtime
|
60
|
-
version_requirements: *id004
|
61
|
-
- !ruby/object:Gem::Dependency
|
48
|
+
version_requirements: *2164957120
|
49
|
+
- !ruby/object:Gem::Dependency
|
62
50
|
name: will_paginate
|
63
|
-
|
64
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
51
|
+
requirement: &2164954240 !ruby/object:Gem::Requirement
|
65
52
|
none: false
|
66
|
-
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version:
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
70
57
|
type: :runtime
|
71
|
-
version_requirements: *id005
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: thoughtbot-shoulda
|
74
58
|
prerelease: false
|
75
|
-
|
59
|
+
version_requirements: *2164954240
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: thoughtbot-shoulda
|
62
|
+
requirement: &2164945480 !ruby/object:Gem::Requirement
|
76
63
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version:
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
81
68
|
type: :development
|
82
|
-
version_requirements: *id006
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: mocha
|
85
69
|
prerelease: false
|
86
|
-
|
70
|
+
version_requirements: *2164945480
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: mocha
|
73
|
+
requirement: &2164944280 !ruby/object:Gem::Requirement
|
87
74
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version:
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
92
79
|
type: :development
|
93
|
-
version_requirements: *id007
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: rspec
|
96
80
|
prerelease: false
|
97
|
-
|
81
|
+
version_requirements: *2164944280
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rspec
|
84
|
+
requirement: &2164942860 !ruby/object:Gem::Requirement
|
98
85
|
none: false
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
102
89
|
version: 2.0.0
|
103
90
|
type: :development
|
104
|
-
|
105
|
-
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *2164942860
|
93
|
+
description: amazon-associates offers object-oriented access to the Amazon Associates
|
94
|
+
API, built on ROXML
|
106
95
|
email: ben.woosley@gmail.com
|
107
96
|
executables: []
|
108
|
-
|
109
97
|
extensions: []
|
110
|
-
|
111
|
-
extra_rdoc_files:
|
98
|
+
extra_rdoc_files:
|
112
99
|
- LICENSE
|
113
100
|
- README.rdoc
|
114
|
-
files:
|
101
|
+
files:
|
115
102
|
- CHANGELOG
|
116
103
|
- LICENSE
|
117
104
|
- README.rdoc
|
@@ -150,6 +137,7 @@ files:
|
|
150
137
|
- lib/amazon-associates/types/requests.rb
|
151
138
|
- spec/requests/browse_node_lookup_spec.rb
|
152
139
|
- spec/requests/item_search_spec.rb
|
140
|
+
- spec/requests/support_spec.rb
|
153
141
|
- spec/spec_helper.rb
|
154
142
|
- spec/types/cart_spec.rb
|
155
143
|
- spec/types/item_spec.rb
|
@@ -162,30 +150,27 @@ files:
|
|
162
150
|
- test/utilities/filesystem_test_helper.rb
|
163
151
|
homepage: http://github.com/Empact/amazon-associates
|
164
152
|
licenses: []
|
165
|
-
|
166
153
|
post_install_message:
|
167
154
|
rdoc_options: []
|
168
|
-
|
169
|
-
require_paths:
|
155
|
+
require_paths:
|
170
156
|
- lib
|
171
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
158
|
none: false
|
173
|
-
requirements:
|
174
|
-
- -
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version:
|
177
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ! '>='
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
164
|
none: false
|
179
|
-
requirements:
|
180
|
-
- -
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version:
|
165
|
+
requirements:
|
166
|
+
- - ! '>='
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
183
169
|
requirements: []
|
184
|
-
|
185
170
|
rubyforge_project:
|
186
|
-
rubygems_version: 1.8.
|
171
|
+
rubygems_version: 1.8.8
|
187
172
|
signing_key:
|
188
173
|
specification_version: 3
|
189
|
-
summary: Generic Amazon Associates Web Service (Formerly ECS) REST API. Supports ECS
|
174
|
+
summary: Generic Amazon Associates Web Service (Formerly ECS) REST API. Supports ECS
|
175
|
+
4.0.
|
190
176
|
test_files: []
|
191
|
-
|