ruby-aaws 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS CHANGED
@@ -1,4 +1,15 @@
1
- $Id: NEWS,v 1.13 2008/09/21 22:25:55 ianmacd Exp $
1
+ $Id: NEWS,v 1.14 2008/10/03 12:00:57 ianmacd Exp $
2
+
3
+
4
+ 0.4.4
5
+ -----
6
+
7
+ It's now possible to have Ruby/AWS use a user configuration file with a name
8
+ other than .amazonrc. This is achieved by defining $AMAZONRCFILE. If left
9
+ undefined, the default of .amazonrc is used.
10
+
11
+ Locations other than $HOME were not being checked for .amazonrc. This bug has
12
+ now been fixed.
2
13
 
3
14
 
4
15
  0.4.3
data/README CHANGED
@@ -1,4 +1,4 @@
1
- $Id: README,v 1.16 2008/09/21 13:26:51 ianmacd Exp $
1
+ $Id: README,v 1.17 2008/10/03 12:00:19 ianmacd Exp $
2
2
 
3
3
 
4
4
  Introduction
@@ -169,16 +169,18 @@ look something like this:
169
169
  cache = false
170
170
 
171
171
  Because you're embedding your key ID in the file, you should protect it (on
172
- UNIX and similar systems) by making it mode 0600:
172
+ UNIX and equivalent systems) by making it mode 0600:
173
173
 
174
174
  $ chmod 600 ~/.amazonrc
175
175
 
176
176
  If you define 'cache' to be 'true', you may also define 'cache_dir' to point
177
177
  to somewhere other the default, /tmp/amazon.
178
178
 
179
- If $HOME is undefined, as is usually the case on Windows, alternative
180
- locations are searched for the user configuration file. In fact, one location
181
- is even searched prior to looking in $HOME.
179
+ If you want to place .amazonrc somewhere other than $HOME, you may set
180
+ $AMAZONRCDIR in the environment, as this location is checked prior to $HOME.
181
+
182
+ If you're using Windows, $HOME is usually undefined, so a number of additional
183
+ locations are checked for .amazonrc.
182
184
 
183
185
  The exact search order is as follows:
184
186
 
@@ -187,8 +189,12 @@ $HOME
187
189
  $HOMEDRIVE + $HOMEPATH
188
190
  $USERPROFILE
189
191
 
190
- So, you can put the user configuration file in any of these locations, but it
191
- must always be called .amazonrc.
192
+ Note that only the first defined location is used, so if, for example, both
193
+ $AMAZONRCDIR and $HOME are defined, but only the path specified by $HOME
194
+ contains a file called .amazonrc, it will not be found.
195
+
196
+ If you want the user configuration file to be called something other than
197
+ .amazonrc, you may define $AMAZONRCFILE in the environment.
192
198
 
193
199
  Once you have your configuration file, you can get started on your code.
194
200
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # $Id: README.rdoc,v 1.18 2008/09/21 22:25:55 ianmacd Exp $
2
+ # $Id: README.rdoc,v 1.19 2008/10/03 12:00:57 ianmacd Exp $
3
3
  #++
4
4
  #
5
5
  #
@@ -120,15 +120,15 @@
120
120
  #
121
121
  # == Download
122
122
  #
123
- # Version 0.4.3
124
- # === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.4.3.tar.gz]
125
- # === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.4.3.gem]
126
- # === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.4.3-1.fc9.noarch.rpm]
127
- # === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.4.3-1.fc9.noarch.rpm]
128
- # === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.4.3-1.fc9.src.rpm]
123
+ # Version 0.4.4
124
+ # === {gzip'ed tar archive}[http://www.caliban.org/files/ruby/ruby-aws-0.4.4.tar.gz]
125
+ # === {Ruby Gem}[http://www.caliban.org/files/ruby/ruby-aaws-0.4.4.gem]
126
+ # === {Fedora 9 RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-0.4.4-1.fc9.noarch.rpm]
127
+ # === {Fedora 9 doc RPM}[http://www.caliban.org/files/redhat/RPMS/noarch/ruby-aws-doc-0.4.4-1.fc9.noarch.rpm]
128
+ # === {Fedora 9 source RPM}[http://www.caliban.org/files/redhat/SRPMS/ruby-aws-0.4.4-1.fc9.src.rpm]
129
129
  #
130
130
  #
131
131
  # ---
132
132
  # Author:: Ian Macdonald <mailto:ian@caliban.org>
133
- # Version:: 0.4.3
133
+ # Version:: 0.4.4
134
134
  # Licence:: GPL[http://www.gnu.org/copyleft/gpl.html]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- # $Id: amazon.rb,v 1.23 2008/09/21 22:24:35 ianmacd Exp $
1
+ # $Id: amazon.rb,v 1.25 2008/10/03 09:35:37 ianmacd Exp $
2
2
  #
3
3
 
4
4
  module Amazon
@@ -83,9 +83,10 @@ module Amazon
83
83
  home = ENV['AMAZONRCDIR'] ||
84
84
  ENV['HOME'] || ENV['HOMEDRIVE'] + ENV['HOMEPATH'] ||
85
85
  ENV['USERPROFILE']
86
+ user_rcfile = ENV['AMAZONRCFILE'] || '.amazonrc'
86
87
 
87
88
  if home
88
- config_files << File.expand_path( File.join( '~', '.amazonrc' ) )
89
+ config_files << File.expand_path( File.join( home, user_rcfile ) )
89
90
  end
90
91
 
91
92
  config_class = File
@@ -1,4 +1,4 @@
1
- # $Id: aws.rb,v 1.71 2008/09/21 22:28:17 ianmacd Exp $
1
+ # $Id: aws.rb,v 1.72 2008/10/03 09:37:25 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.4.3'
15
+ VERSION = '0.4.4'
16
16
  USER_AGENT = '%s %s' % [ NAME, VERSION ]
17
17
 
18
18
  # Default Associate tags to use per locale.
File without changes
@@ -1,4 +1,4 @@
1
- # $Id: tc_aws.rb,v 1.9 2008/09/08 21:23:01 ianmacd Exp $
1
+ # $Id: tc_aws.rb,v 1.11 2008/10/02 21:33:58 ianmacd Exp $
2
2
  #
3
3
 
4
4
  require 'test/unit'
@@ -93,17 +93,36 @@ class TestAWSBasics < AWSTest
93
93
  end
94
94
 
95
95
  def test_config
96
+ # Test bad quoting.
97
+ #
96
98
  assert_raise( Amazon::Config::ConfigError ) do
97
99
  cf = Amazon::Config.new( <<' EOF' )
98
100
  bad_syntax = 'bad quotes"
99
101
  EOF
100
102
  end
101
103
 
104
+ # Test good quoting.
105
+ #
102
106
  assert_nothing_raised do
103
107
  cf = Amazon::Config.new( <<' EOF' )
104
108
  good_syntax = 'good quotes'
105
109
  EOF
106
110
  end
111
+
112
+ # Test that config files are properly read from $AMAZONRC.
113
+ #
114
+ Dir.mktmpdir do |td|
115
+ ENV['AMAZONRCDIR'] = td
116
+ ENV['AMAZONRCFILE'] = '.user_defined_name'
117
+ File.open( File.join( td, '.user_defined_name' ), 'w' ) do |tf|
118
+ tf.puts( 'foo = bar' )
119
+ end
120
+
121
+ cf = Amazon::Config.new
122
+ assert_equal( 'bar', cf['foo'] )
123
+ ENV['AMAZONRCDIR'] = nil
124
+ ENV['AMAZONRCFILE'] = nil
125
+ end
107
126
  end
108
127
 
109
128
  def test_exceptions
metadata CHANGED
@@ -1,33 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: ruby-aaws
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.4.3
7
- date: 2008-09-22 00:00:00 +02:00
8
- summary: Ruby interface to Amazon Associates Web Services
9
- require_paths:
10
- - lib
11
- email: ian@caliban.org
12
- homepage:
13
- rubyforge_project:
14
- description:
15
- autorequire: amazon/aws/search
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.8.6
24
- version:
4
+ version: 0.4.4
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Ian Macdonald
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-10-03 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: ian@caliban.org
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - COPYING
24
+ - NEWS
25
+ - README
26
+ - README.rdoc
31
27
  files:
32
28
  - example/customer_content_lookup1
33
29
  - example/browse_node_lookup1
@@ -68,6 +64,32 @@ files:
68
64
  - NEWS
69
65
  - README
70
66
  - README.rdoc
67
+ has_rdoc: true
68
+ homepage: http://www.caliban.org/ruby/ruby-aws/
69
+ post_install_message:
70
+ rdoc_options: []
71
+
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 1.8.6
79
+ version:
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ requirements: []
87
+
88
+ rubyforge_project: Ruby/(A)AWS
89
+ rubygems_version: 1.2.0
90
+ signing_key:
91
+ specification_version: 2
92
+ summary: Ruby interface to Amazon Associates Web Services
71
93
  test_files:
72
94
  - test/tc_amazon.rb
73
95
  - test/setup.rb
@@ -78,18 +100,3 @@ test_files:
78
100
  - test/tc_shopping_cart.rb
79
101
  - test/ts_aws.rb
80
102
  - test/tc_serialisation.rb
81
- rdoc_options: []
82
-
83
- extra_rdoc_files:
84
- - COPYING
85
- - NEWS
86
- - README
87
- - README.rdoc
88
- executables: []
89
-
90
- extensions: []
91
-
92
- requirements: []
93
-
94
- dependencies: []
95
-