ruby-aaws 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/INSTALL ADDED
@@ -0,0 +1,260 @@
1
+ $Id: INSTALL,v 1.9 2009/06/15 12:17:56 ianmacd Exp $
2
+
3
+ Requirements
4
+ ------------
5
+
6
+ Ruby/AWS depends on Ruby 1.8.7 or later in the 1.8 series. It has also been
7
+ tested to work with Ruby 1.9.1p129, the latest in the 1.9 series at the time
8
+ of writing.
9
+
10
+ You will also need at least version 0.9.8 of the OpenSSL libraries in order to
11
+ use the the signature authentication code.
12
+
13
+
14
+ Installation
15
+ ------------
16
+
17
+ There are two ways to install Ruby/AWS.
18
+
19
+ The standard way, which requires no extra software, uses Minero Aoki's
20
+ setup.rb script. Extensive documentation for this script can be found at the
21
+ end of this document.
22
+
23
+ The following commands should be enough to install the package:
24
+
25
+ $ ruby setup.rb config
26
+ $ ruby setup.rb setup
27
+ # ruby setup.rb install
28
+
29
+ ("#" line may require root privilege)
30
+
31
+ Alternatively, the RubyGems packaging system may be used:
32
+
33
+ $ wget http://www.caliban.org/files/ruby/ruby-aaws-x.x.x.gem
34
+ # gem install ruby-aaws-x.x.x.gem
35
+
36
+ ("#" line may require root privilege)
37
+
38
+ Or even just:
39
+
40
+ # gem install ruby-aaws
41
+
42
+ ("#" line may require root privilege)
43
+
44
+ See http://www.rubygems.org/ for more information on using RubyGems.
45
+
46
+
47
+ Documentation
48
+ -------------
49
+
50
+ To create HTML documentation for Ruby/AWS, use rdoc as follows:
51
+
52
+ $ rdoc -SUx CVS lib
53
+
54
+ rdoc has been bundled with Ruby since 1.8.1.
55
+
56
+
57
+
58
+ -----------------------------------------------------------------------------
59
+
60
+ Full instructions for setup.rb:
61
+
62
+ Details
63
+ -------
64
+
65
+ Usage of install.rb/setup.rb is:
66
+
67
+ ruby install.rb <global options>
68
+ ruby install.rb [<global options>] <task> [<task options>]
69
+
70
+
71
+ -q,--quiet
72
+ suppress message outputs
73
+ --verbose
74
+ output messages verbosely (default)
75
+ -h,--help
76
+ prints help and quit
77
+ -v,--version
78
+ prints version and quit
79
+ --copyright
80
+ prints copyright and quit
81
+
82
+ These are acceptable tasks:
83
+ config
84
+ saves configurations
85
+ show
86
+ prints current configurations
87
+ setup
88
+ compiles extentions
89
+ install
90
+ installs files
91
+ clean
92
+ cleans created files
93
+
94
+ Task Options for Config
95
+ -----------------------
96
+
97
+ --prefix=PATH
98
+ a prefix of the installing directory path
99
+ --std-ruby=PATH
100
+ the directory for standard ruby libraries
101
+ --site-ruby-common=PATH
102
+ the directory for version-independent non-standard
103
+ ruby libraries
104
+ --site-ruby=PATH
105
+ the directory for non-standard ruby libraries
106
+ --bin-dir=PATH
107
+ the directory for commands
108
+ --rb-dir=PATH
109
+ the directory for ruby scripts
110
+ --so-dir=PATH
111
+ the directory for ruby extentions
112
+ --data-dir=PATH
113
+ the directory for shared data
114
+ --ruby-path=PATH
115
+ path to set to #! line
116
+ --ruby-prog=PATH
117
+ the ruby program using for installation
118
+ --make-prog=NAME
119
+ the make program to compile ruby extentions
120
+ --without-ext
121
+ forces to install.rb never to compile/install
122
+ ruby extentions.
123
+ --rbconfig=PATH
124
+ your rbconfig.rb to load
125
+
126
+ You can view default values of these options by typing
127
+
128
+ $ ruby install.rb --help
129
+
130
+
131
+ In addition, setup.rb accepts these options:
132
+ --with=NAME,NAME,NAME...
133
+ package names which you want to install
134
+ --without=NAME,NAME,NAME...
135
+ package names which you do not want to install
136
+
137
+ [NOTE] You can pass options for extconf.rb like this:
138
+
139
+ ruby install.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
140
+
141
+
142
+ Task Options for Install
143
+ ------------------------
144
+
145
+ --no-harm
146
+ prints what to do and done nothing really.
147
+ --prefix=PATH
148
+ a prefix of the installing directory path.
149
+ This option may help binary package maintainers.
150
+ A default value is an empty string.
151
+
152
+ Installing Programs with setup.rb
153
+ =================================
154
+
155
+ Quick Start
156
+ -----------
157
+
158
+ Type these lines on command line:
159
+ ("#" line may require root privilege)
160
+
161
+ $ ruby setup.rb config
162
+ $ ruby setup.rb setup
163
+ # ruby setup.rb install
164
+
165
+
166
+ Details
167
+ -------
168
+
169
+ Usage of setup.rb is:
170
+
171
+ ruby setup.rb <global options>
172
+ ruby setup.rb [<global options>] <task> [<task options>]
173
+
174
+
175
+ Global Options
176
+ --------------
177
+
178
+ -q,--quiet
179
+ suppress message outputs
180
+ --verbose
181
+ output messages verbosely (default)
182
+ -h,--help
183
+ prints help and quit
184
+ -v,--version
185
+ prints version and quit
186
+ --copyright
187
+ prints copyright and quit
188
+
189
+ These are acceptable tasks:
190
+ config
191
+ Checks and saves configurations.
192
+ show
193
+ Prints current configurations.
194
+ setup
195
+ Compiles ruby extentions.
196
+ install
197
+ Installs files.
198
+ clean
199
+ Cleans created files.
200
+ distclean
201
+ Cleans created files.
202
+
203
+ Task Options for CONFIG
204
+ -----------------------
205
+
206
+ --prefix=PATH
207
+ a prefix of the installing directory path
208
+ --std-ruby=PATH
209
+ the directory for standard ruby libraries
210
+ --site-ruby-common=PATH
211
+ the directory for version-independent non-standard
212
+ ruby libraries
213
+ --site-ruby=PATH
214
+ the directory for non-standard ruby libraries
215
+ --bin-dir=PATH
216
+ the directory for commands
217
+ --rb-dir=PATH
218
+ the directory for ruby scripts
219
+ --so-dir=PATH
220
+ the directory for ruby extentions
221
+ --data-dir=PATH
222
+ the directory for shared data
223
+ --ruby-path=PATH
224
+ path to set to #! line
225
+ --ruby-prog=PATH
226
+ the ruby program using for installation
227
+ --make-prog=NAME
228
+ the make program to compile ruby extentions
229
+ --without-ext
230
+ forces to setup.rb never to compile/install
231
+ ruby extentions.
232
+ --rbconfig=PATH
233
+ your rbconfig.rb to load
234
+
235
+ You can view default values of these options by typing
236
+
237
+ $ ruby setup.rb --help
238
+
239
+
240
+ If there's the directory named "packages",
241
+ You can also use these options:
242
+ --with=NAME,NAME,NAME...
243
+ Package names which you want to install.
244
+ --without=NAME,NAME,NAME...
245
+ Package names which you do not want to install.
246
+
247
+ [NOTE] You can pass options for extconf.rb like this:
248
+
249
+ ruby setup.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
250
+
251
+
252
+ Task Options for INSTALL
253
+ ------------------------
254
+
255
+ --no-harm
256
+ prints what to do and done nothing really.
257
+ --prefix=PATH
258
+ The prefix of the installing directory path.
259
+ This option may help binary package maintainers.
260
+ A default value is an empty string.
data/NEWS CHANGED
@@ -1,4 +1,119 @@
1
- $Id: NEWS,v 1.18 2009/05/26 15:25:19 ianmacd Exp $
1
+ $Id: NEWS,v 1.19 2009/06/15 23:48:49 ianmacd Exp $
2
+
3
+
4
+ 0.7.0 - 2009-06-16
5
+ ------------------
6
+
7
+ 1. This release introduces a shorthand module method for each of the AWS
8
+ operations. These can be used to create less verbose code at the expense of
9
+ flexibility.
10
+
11
+ For example, we might normally write the following code:
12
+
13
+ is = ItemSearch.new( 'Books', { 'Title' => 'Ruby' } )
14
+ rg = ResponseGroup.new( :Large )
15
+ req = Request.new
16
+ response = req.search( is, rg )
17
+
18
+ but we could instead use ItemSearch's associated module method as follows:
19
+
20
+ response = Amazon::AWS.item_search( 'Books', { 'Title' => 'Ruby' } )
21
+
22
+ There are some important restrictions when compared to the standard way of
23
+ doing things:
24
+
25
+ a. Astute readers will note that there's no way to specify to the module
26
+ methods which response group(s) to use. Instead, a reasonable default
27
+ set for each type of operation will be used, as per the new
28
+ ResponseGroup::DEFAULT hash.
29
+
30
+ The exception to this is Amazon::AWS.multiple_operation, which has no
31
+ response groups of its own, instead applying those of the operations it
32
+ combines.
33
+
34
+ Because no access is provided to the Request object used by the module
35
+ method, it's also not possible to batch operations with Operation#batch
36
+ when using this form of the search.
37
+
38
+ On the other hand, you can use the Amazon::AWS.multiple_operation module
39
+ method to achieve more or less the same thing:
40
+
41
+ Amazon::AWS.multiple_operation( op1, op2 )
42
+
43
+ When op1 and op2 are of the same class, the effect is similar to
44
+ batching two operations. The main difference is in the structure of the
45
+ XML document returned by AWS.
46
+
47
+ b. Similarly, one can't influence the key ID, associate tag, locale, cache
48
+ or user agent used for the request. These are all set as per
49
+ ~/.amazonrc.
50
+
51
+ Likewise, the number of results pages to fetch will always be 1.
52
+
53
+ c. The module methods have no RDoc documentation, because they are
54
+ dynamically generated.
55
+
56
+ Basically, the short form module methods are there as a convenience, but
57
+ that convenience comes at the expense of flexibility. If they don't meet
58
+ your needs, you will have to resort to the standard longhand form.
59
+
60
+ 2. There's now an alternative to passing the list of desired response groups
61
+ as the second parameter to Request#search.
62
+
63
+ The second parameter of that method is now optional and *nil* by default.
64
+ Instead, you may assign to the response_group attribute of your operation
65
+ object.
66
+
67
+ For example:
68
+
69
+ is = ItemSearch.new( 'Books', { 'Title' => 'Ruby' } )
70
+ is.response_group = ResponseGroup.new( :Large )
71
+ req = Request.new
72
+ response = req.search( is )
73
+
74
+ Note that the @response_group variable will be initialised at the
75
+ time the operation object is instantiated. It will be assigned the same
76
+ reasonable default as used by the equivalent module method, namely
77
+ that specified by the new ResponseGroup::DEFAULT hash.
78
+
79
+ Specifying the desired response groups inside your operation object has at
80
+ least two advantages over passing the list to Request#search:
81
+
82
+ a. You can maintain a separate response group set per operation, rather
83
+ than having to pass a differen set to Request#search for each operation.
84
+
85
+ b. A reasonable default response group set can be used for any given
86
+ operation if you don't supply one.
87
+
88
+ 3. More and more people are moving to Ruby 1.9, so this release of Ruby/AWS
89
+ has been tested to work with Ruby 1.9.1p129, the latest version at the time
90
+ of writing. Attaining ompatibility with 1.9 is a little tricky, because of
91
+ the way in which strings are no longer treated as sequences of bytes in
92
+ that version. Instead, they have knowledge of their encoding.
93
+
94
+ There may be one or two obscure 1.9-related bugs remaining, but all of the
95
+ unit tests pass, at least.
96
+
97
+ 4. The signing of requests, introduced in Ruby/AWS 0.6.0, produced problems
98
+ for people with a version of OpenSSL earlier than 0.9.8.
99
+
100
+ The code will now check whether there is OpenSSL support for the SHA-256
101
+ Secure Hash Algorithm before attempting to use it. If not, each attempt to
102
+ sign a request will result in a warning if $DEBUG is used.
103
+
104
+ Once again, I remind you that Amazon intends to make request authentication
105
+ compulsory on 15th August 2009, so this change to Ruby/AWS only lets users
106
+ with an ancient OpenSSL library off the hook until then.
107
+
108
+ 5. A second bug with the signing of requests occurred on Windows platforms.
109
+ Requests were not properly timestamped. This was due to deficiencies in the
110
+ underlying strftime(3) library function, but has now been fixed.
111
+
112
+ 6. Finally, knowledge of a handful of relatively new search indices, such as
113
+ UnboxVideo, was missing. This has now been added. The AWS documentation is
114
+ terribly inconsistent in this regard, providing several different, yet
115
+ supposedly complete lists of valid search indices at various points
116
+ throughout the document.
2
117
 
3
118
 
4
119
  0.6.0 - 2009-05-26
data/README CHANGED
@@ -1,4 +1,4 @@
1
- $Id: README,v 1.21 2009/05/25 23:38:24 ianmacd Exp $
1
+ $Id: README,v 1.23 2009/06/15 12:07:51 ianmacd Exp $
2
2
 
3
3
 
4
4
  Introduction
@@ -11,7 +11,7 @@ site, the local sites amazon.co.uk, amazon.de, amazon.fr, amazon.ca and
11
11
  amazon.co.jp are also supported.
12
12
 
13
13
  Development of Ruby/AWS has been quite swift since the appearance of the first
14
- alpha version, 0.0.1, in late March 2008. Although Ruby/AWS shares almost no
14
+ alpha version, 0.0.1, in late March of 2008. Although Ruby/AWS shares almost no
15
15
  code with its now obsolete predecessor, Ruby/Amazon, many lessons were learnt
16
16
  whilst developing that library, and the experience gained has been rolled into
17
17
  Ruby/AWS.
@@ -44,6 +44,12 @@ to call this library by a name so general as Ruby/Amazon, because it
44
44
  provides an interface to just one of the Amazon Web APIs. Therefore, the
45
45
  monicker for this library is Ruby/AWS.
46
46
 
47
+ Unfortunately for Ruby/AWS, Amazon changed the name once again in May 2009,
48
+ referring to it now as the Product Advertising API. Changing Ruby/AWS's name
49
+ would create more confusion than it would mitigate, however, so I'm not about
50
+ to do so. Similarly, I will continue to refer to the Amazon API in question as
51
+ AWS.
52
+
47
53
  Ruby/AWS is built around version 4 of the Amazon AWS API, which is
48
54
  fundamentally different to version 3, both in terms of how requests are made
49
55
  and the data returned. The underlying structure of the XML response has
@@ -132,7 +138,7 @@ Ruby/AWS is currently beta software. Amongst other things, this means:
132
138
  CartModify
133
139
  CartClear
134
140
 
135
- Version 0.4.0 adds the remaining shopping-cart operation, which I had first
141
+ Version 0.4.0 added the remaining shopping-cart operation, which I had first
136
142
  thought superfluous:
137
143
 
138
144
  CartGet
@@ -194,9 +200,9 @@ Its contents should look something like this:
194
200
  locale = 'uk'
195
201
  encoding = 'iso-8859-15'
196
202
 
197
- Including your secret key is a new feature in version 0.6.0 of Ruby/AWS. If
198
- you choose to do so, your requests to AWS will be signed for authentication by
199
- the Amazon's servers.
203
+ The ability to include your secret key was a feature added in version 0.6.0 of
204
+ Ruby/AWS. If you choose to do so, your requests to AWS will be signed for
205
+ authentication by the Amazon's servers.
200
206
 
201
207
  Amazon plans to make this practice obligatory as of 15th August 2009, so I
202
208
  recommend that you adopt it well ahead of time.
@@ -330,7 +336,7 @@ AWS as an HTTP GET operation:
330
336
 
331
337
  http://ecs.amazonaws.co.uk/onca/xml?AWSAccessKeyId=01234567890123456789&AssociateTag=calibanorg-21&Operation=ItemSearch&ResponseGroup=Small&SearchIndex=Books&Service=AWSECommerceService&Title=Ruby&Version=2008-03-03
332
338
 
333
- The following (truncated) AWS XML response was received:
339
+ The following (abbreviated) AWS XML response was received:
334
340
 
335
341
  <ItemSearchResponse>
336
342
  <OperationRequest>
@@ -1,5 +1,5 @@
1
1
  #--
2
- # $Id: README.rdoc,v 1.23 2009/05/26 15:25:19 ianmacd Exp $
2
+ # $Id: README.rdoc,v 1.25 2009/06/15 23:51:11 ianmacd Exp $
3
3
  #++
4
4
  #
5
5
  #
@@ -118,9 +118,11 @@
118
118
  # {mailing-list}[http://www.caliban.org/mailman/listinfo/ruby-aws] available,
119
119
  # where you can discuss any Ruby/AWS-related subjects and issues.
120
120
  #
121
- # Please see the Amazon Web Services API
121
+ # Please see the AWS Developer Resources {home
122
+ # page}[https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html],
123
+ # the Amazon Web Services API
122
124
  # documentation[http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=5],
123
- # not forgetting the {release
125
+ # and, in particular, the {release
124
126
  # notes}[http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=17]
125
127
  # for definitive information on the capabilities and inner workings of the AWS
126
128
  # API.
@@ -128,16 +130,16 @@
128
130
  #
129
131
  # == Download
130
132
  #
131
- # Version 0.6.0
132
- # === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.6.0.tar.gz]
133
- # === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.6.0.gem]
134
- # === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.6.0-1.fc9.noarch.rpm]
135
- # === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.6.0-1.fc9.noarch.rpm]
136
- # === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.6.0-1.fc9.src.rpm]
133
+ # Version 0.7.0
134
+ # === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.7.0.tar.gz]
135
+ # === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.7.0.gem]
136
+ # === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.7.0-1.fc9.noarch.rpm]
137
+ # === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.7.0-1.fc9.noarch.rpm]
138
+ # === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.7.0-1.fc9.src.rpm]
137
139
  #
138
140
  #
139
141
  # ---
140
142
  # Author:: Ian Macdonald <mailto:ian@caliban.org>
141
- # Version:: 0.6.0
143
+ # Version:: 0.7.0
142
144
  # Copyright:: (C) 2008-2009 Ian Macdonald
143
145
  # Licence:: GPL[http://www.gnu.org/copyleft/gpl.html]