ruby-aaws 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +17 -2
- data/README +3 -3
- data/README.rdoc +8 -8
- data/lib/amazon/aws.rb +13 -5
- data/test/tc_shopping_cart.rb +9 -9
- data/test/tc_vehicle_operations.rb +0 -0
- metadata +2 -2
data/NEWS
CHANGED
@@ -1,7 +1,22 @@
|
|
1
|
-
$Id: NEWS,v 1.
|
1
|
+
$Id: NEWS,v 1.17 2009/03/28 23:04:22 ianmacd Exp $
|
2
2
|
|
3
3
|
|
4
|
-
0.5.
|
4
|
+
0.5.1 - 2009-03-29
|
5
|
+
------------------
|
6
|
+
|
7
|
+
1. Catch Errno::EPIPE on server connections (Errno::ECONNRESET was already
|
8
|
+
caught). This can occur when the connection times out due to lack of use.
|
9
|
+
Running Ruby in debug mode will print the error message text when such an
|
10
|
+
exception is caught.
|
11
|
+
|
12
|
+
2. The version of the AWS API used is now 2009-02-01, the latest at the time
|
13
|
+
of writing.
|
14
|
+
|
15
|
+
3. The sequence numbering of shopping cart items incorrectly started from 2
|
16
|
+
instead of 1, but didn't cause a problem in practice.
|
17
|
+
|
18
|
+
|
19
|
+
0.5.0 - 2009-02-20
|
5
20
|
------------------
|
6
21
|
|
7
22
|
1. The configuration files (/etc/amazonrc and typically ~/.amazonrc) are now
|
data/README
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
$Id: README,v 1.
|
1
|
+
$Id: README,v 1.20 2009/03/28 23:04:23 ianmacd Exp $
|
2
2
|
|
3
3
|
|
4
4
|
Introduction
|
@@ -79,10 +79,10 @@ Please obtain and use an AWS Access Key ID instead.
|
|
79
79
|
API version
|
80
80
|
-----------
|
81
81
|
|
82
|
-
Ruby/AWS currently requests the 2009-01
|
82
|
+
Ruby/AWS currently requests the 2009-02-01 revision of the AWS API when
|
83
83
|
performing its operations:
|
84
84
|
|
85
|
-
http://docs.amazonwebservices.com/AWSECommerceService/2009-01
|
85
|
+
http://docs.amazonwebservices.com/AWSECommerceService/2009-02-01/DG/
|
86
86
|
|
87
87
|
However, a different version can be requested via the 'api' parameter in the
|
88
88
|
user configuration file.
|
data/README.rdoc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# $Id: README.rdoc,v 1.
|
2
|
+
# $Id: README.rdoc,v 1.22 2009/03/28 23:04:23 ianmacd Exp $
|
3
3
|
#++
|
4
4
|
#
|
5
5
|
#
|
@@ -123,16 +123,16 @@
|
|
123
123
|
#
|
124
124
|
# == Download
|
125
125
|
#
|
126
|
-
# Version 0.5.
|
127
|
-
# === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.5.
|
128
|
-
# === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.5.
|
129
|
-
# === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.5.
|
130
|
-
# === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.5.
|
131
|
-
# === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.5.
|
126
|
+
# Version 0.5.1
|
127
|
+
# === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.5.1.tar.gz]
|
128
|
+
# === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.5.1.gem]
|
129
|
+
# === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.5.1-1.fc9.noarch.rpm]
|
130
|
+
# === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.5.1-1.fc9.noarch.rpm]
|
131
|
+
# === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.5.1-1.fc9.src.rpm]
|
132
132
|
#
|
133
133
|
#
|
134
134
|
# ---
|
135
135
|
# Author:: Ian Macdonald <mailto:ian@caliban.org>
|
136
|
-
# Version:: 0.5.
|
136
|
+
# Version:: 0.5.1
|
137
137
|
# Copyright:: (C) 2008-2009 Ian Macdonald
|
138
138
|
# Licence:: GPL[http://www.gnu.org/copyleft/gpl.html]
|
data/lib/amazon/aws.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: aws.rb,v 1.
|
1
|
+
# $Id: aws.rb,v 1.89 2009/03/28 23:04:23 ianmacd Exp $
|
2
2
|
#
|
3
3
|
#:include: ../../README.rdoc
|
4
4
|
|
@@ -12,7 +12,7 @@ module Amazon
|
|
12
12
|
require 'rexml/document'
|
13
13
|
|
14
14
|
NAME = '%s/%s' % [ Amazon::NAME, 'AWS' ]
|
15
|
-
VERSION = '0.
|
15
|
+
VERSION = '0.5.1'
|
16
16
|
USER_AGENT = '%s %s' % [ NAME, VERSION ]
|
17
17
|
|
18
18
|
# Default Associate tags to use per locale.
|
@@ -30,7 +30,7 @@ module Amazon
|
|
30
30
|
# changed via the user configuration file.
|
31
31
|
#
|
32
32
|
SERVICE = { 'Service' => 'AWSECommerceService',
|
33
|
-
'Version' => '2009-01
|
33
|
+
'Version' => '2009-02-01'
|
34
34
|
}
|
35
35
|
|
36
36
|
# Maximum number of 301 and 302 HTTP responses to follow, should Amazon
|
@@ -124,7 +124,8 @@ module Amazon
|
|
124
124
|
# just not passed by here recently), the HTTP connection to the server
|
125
125
|
# will probably have timed out.
|
126
126
|
#
|
127
|
-
rescue Errno::ECONNRESET
|
127
|
+
rescue Errno::ECONNRESET, Errno::EPIPE => error
|
128
|
+
Amazon.dprintf( 'Connection to server lost: %s. Retrying...', error )
|
128
129
|
conn = request.reconnect.conn
|
129
130
|
retry
|
130
131
|
end
|
@@ -646,7 +647,14 @@ module Amazon
|
|
646
647
|
#
|
647
648
|
op_str = 'Item' if op_str =~ /^Cart/
|
648
649
|
|
649
|
-
all_parameters =
|
650
|
+
all_parameters = b_params
|
651
|
+
|
652
|
+
# Shopping carts pass an empty hash in params, so we have to ditch
|
653
|
+
# params in such a case to prevent the batch index from being off by
|
654
|
+
# one.
|
655
|
+
#
|
656
|
+
all_parameters.concat( [ params ] ) unless params.empty?
|
657
|
+
|
650
658
|
params = {}
|
651
659
|
|
652
660
|
all_parameters.each_with_index do |hash, index|
|
data/test/tc_shopping_cart.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: tc_shopping_cart.rb,v 1.
|
1
|
+
# $Id: tc_shopping_cart.rb,v 1.6 2009/03/27 14:00:22 ianmacd Exp $
|
2
2
|
#
|
3
3
|
|
4
4
|
require 'test/unit'
|
@@ -23,7 +23,7 @@ class TestShoppingCart < AWSTest
|
|
23
23
|
# Create a cart with three items. The last two are given as multiple
|
24
24
|
# single-element hashes. MergeCart is false.
|
25
25
|
#
|
26
|
-
cart.cart_create( :ASIN, '
|
26
|
+
cart.cart_create( :ASIN, 'B001CB0UJC', 3, false,
|
27
27
|
{ 'B000WC4AH0' => 2 },
|
28
28
|
{ 'B0006L16N8' => 1 } )
|
29
29
|
items = cart.items
|
@@ -31,7 +31,7 @@ class TestShoppingCart < AWSTest
|
|
31
31
|
# Check that the quantities match what we expect.
|
32
32
|
#
|
33
33
|
assert_equal( 3, items.size )
|
34
|
-
item = items.find { |item| item.asin == '
|
34
|
+
item = items.find { |item| item.asin == 'B001CB0UJC' }
|
35
35
|
assert_equal( '3', item.quantity[0] )
|
36
36
|
item = items.find { |item| item.asin == 'B000WC4AH0' }
|
37
37
|
assert_equal( '2', item.quantity[0] )
|
@@ -70,7 +70,7 @@ class TestShoppingCart < AWSTest
|
|
70
70
|
# hash. MergeCart is true. Cart#create is used as an alias of
|
71
71
|
# Cart#cart_create.
|
72
72
|
#
|
73
|
-
cart.create( :ASIN, '
|
73
|
+
cart.create( :ASIN, 'B001CB0UJC', 1, true,
|
74
74
|
{ 'B000WC4AH0' => 2,
|
75
75
|
'B0006L16N8' => 3 } )
|
76
76
|
items = cart.items
|
@@ -78,7 +78,7 @@ class TestShoppingCart < AWSTest
|
|
78
78
|
# Check that the quantities match what we expect.
|
79
79
|
#
|
80
80
|
assert_equal( 3, items.size )
|
81
|
-
item = items.find { |item| item.asin == '
|
81
|
+
item = items.find { |item| item.asin == 'B001CB0UJC' }
|
82
82
|
assert_equal( '1', item.quantity[0] )
|
83
83
|
item = items.find { |item| item.asin == 'B000WC4AH0' }
|
84
84
|
assert_equal( '2', item.quantity[0] )
|
@@ -125,10 +125,10 @@ class TestShoppingCart < AWSTest
|
|
125
125
|
|
126
126
|
# Modify an item quantity.
|
127
127
|
#
|
128
|
-
cart.cart_modify( :ASIN, '
|
128
|
+
cart.cart_modify( :ASIN, 'B001CB0UJC', 2 )
|
129
129
|
items = cart.items
|
130
130
|
assert_equal( 8, items.size )
|
131
|
-
item = items.find { |item| item.asin == '
|
131
|
+
item = items.find { |item| item.asin == 'B001CB0UJC' }
|
132
132
|
assert_equal( '2', item.quantity[0] )
|
133
133
|
|
134
134
|
# Move item to 'Save For Later' area.
|
@@ -174,7 +174,7 @@ class TestShoppingCart < AWSTest
|
|
174
174
|
|
175
175
|
# Move another item to the 'Save For Later' area.
|
176
176
|
#
|
177
|
-
cart.cart_modify( :ASIN, '
|
177
|
+
cart.cart_modify( :ASIN, 'B001CB0UJC', 2, true )
|
178
178
|
items = cart.items
|
179
179
|
assert_equal( 6, items.size )
|
180
180
|
sfl_items = cart.saved_for_later_items
|
@@ -182,7 +182,7 @@ class TestShoppingCart < AWSTest
|
|
182
182
|
|
183
183
|
# Now remove that item while it's still in the 'Save For Later' area.
|
184
184
|
#
|
185
|
-
cart.cart_modify( :ASIN, '
|
185
|
+
cart.cart_modify( :ASIN, 'B001CB0UJC', 0 )
|
186
186
|
items = cart.items
|
187
187
|
assert_equal( 6, items.size )
|
188
188
|
sfl_items = cart.saved_for_later_items
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-aaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Macdonald
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-29 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|