kerryb-right_aws 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +172 -0
- data/Manifest.txt +32 -0
- data/README.txt +146 -0
- data/Rakefile +96 -0
- data/lib/awsbase/benchmark_fix.rb +39 -0
- data/lib/awsbase/file_fix.rb +33 -0
- data/lib/awsbase/right_awsbase.rb +660 -0
- data/lib/awsbase/support.rb +111 -0
- data/lib/ec2/right_ec2.rb +1223 -0
- data/lib/right_aws.rb +69 -0
- data/lib/s3/right_s3.rb +1056 -0
- data/lib/s3/right_s3_interface.rb +990 -0
- data/lib/sdb/active_sdb.rb +695 -0
- data/lib/sdb/right_sdb_interface.rb +475 -0
- data/lib/sqs/right_sqs.rb +380 -0
- data/lib/sqs/right_sqs_gen2.rb +278 -0
- data/lib/sqs/right_sqs_gen2_interface.rb +451 -0
- data/lib/sqs/right_sqs_interface.rb +604 -0
- data/test/ec2/test_helper.rb +2 -0
- data/test/ec2/test_right_ec2.rb +76 -0
- data/test/http_connection.rb +87 -0
- data/test/s3/test_helper.rb +2 -0
- data/test/s3/test_right_s3.rb +388 -0
- data/test/s3/test_right_s3_stubbed.rb +95 -0
- data/test/sdb/test_active_sdb.rb +249 -0
- data/test/sdb/test_helper.rb +2 -0
- data/test/sdb/test_right_sdb.rb +147 -0
- data/test/sqs/test_helper.rb +2 -0
- data/test/sqs/test_right_sqs.rb +291 -0
- data/test/sqs/test_right_sqs_gen2.rb +209 -0
- data/test/test_credentials.rb +37 -0
- data/test/ts_right_aws.rb +13 -0
- metadata +106 -0
data/History.txt
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
== 1.1.0 2007-08-10
|
2
|
+
Initial release.
|
3
|
+
|
4
|
+
== 1.2.0 2007-09-12
|
5
|
+
|
6
|
+
* r1718, todd, 2007-09-12 15:34:37
|
7
|
+
* # 458, Extensive documentation review, rework, and expansion. Also added
|
8
|
+
coverage analysis to the test suite using RCov.
|
9
|
+
|
10
|
+
* r1690, todd, 2007-09-07 15:23:11
|
11
|
+
* # 447, Add support.rb to manifest
|
12
|
+
|
13
|
+
* r1688, todd, 2007-09-07 13:57:39
|
14
|
+
* # 447, Use Active Support if available, but don't require it. Load our own
|
15
|
+
extensions if it's not present. This keeps us from overloading ActiveSupport if
|
16
|
+
a user's already using it.
|
17
|
+
|
18
|
+
* r1687, todd, 2007-09-07 11:36:43
|
19
|
+
* # 447, Removed dependency on activesupport
|
20
|
+
|
21
|
+
* r1676, konstantin, 2007-09-06 01:27:09
|
22
|
+
* paid AMIs, small fix
|
23
|
+
|
24
|
+
* r1667, konstantin, 2007-09-05 12:58:10
|
25
|
+
* # 427, paid AMI support for ec2_instances
|
26
|
+
|
27
|
+
* r1658, konstantin, 2007-09-05 01:02:25
|
28
|
+
* params improvements for ec2.describe_xxx, now ones can use a String as well as an Array.
|
29
|
+
|
30
|
+
* r1653, konstantin, 2007-09-04 12:31:19
|
31
|
+
* libxml and paid AMI support added
|
32
|
+
|
33
|
+
* r1581, tve, 2007-08-24 16:21:45
|
34
|
+
* Improved RightAws documentation
|
35
|
+
|
36
|
+
== 1.3.0 2007-09-26
|
37
|
+
|
38
|
+
* r1754, todd, 2007-09-19 13:48:34
|
39
|
+
* # 487, # 488, Consolidate a lot of code that was repeated in three places.
|
40
|
+
Fix error handling path when using streaming GET interfaces with S3.
|
41
|
+
Also add a stub for RightHttpConnection which allows more control over the
|
42
|
+
unit tests. Expand the unit tests and coverage tests.
|
43
|
+
|
44
|
+
* r1755, todd, 2007-09-19 14:29:19
|
45
|
+
* # 487, RDoc fixes after code consolidation
|
46
|
+
|
47
|
+
* r1866, konstantin, 2007-10-05 06:17:36
|
48
|
+
* # 220, close connection on HTTP 5xx/4xx errors
|
49
|
+
|
50
|
+
== 1.4.0 2007-10-10
|
51
|
+
|
52
|
+
* r1868, konstantin, 2007-10-05 06:38:37
|
53
|
+
* # 220, inst_type branch merge into 1.3.0 release
|
54
|
+
|
55
|
+
* r1869, konstantin, 2007-10-05 07:32:34
|
56
|
+
* right_http_connection 1.1.1 requirements fixed
|
57
|
+
|
58
|
+
* r1879, konstantin, 2007-10-07 02:11:24
|
59
|
+
* # 524, blocks added to ec2_describe_xxx to support aws_cache
|
60
|
+
|
61
|
+
* r1924, konstantin, 2007-10-12 11:35:06
|
62
|
+
* # 536, user_data bug fix
|
63
|
+
|
64
|
+
* r1929, tve, 2007-10-15 00:00:11
|
65
|
+
* Fix libxml/rexml selection bug
|
66
|
+
|
67
|
+
* r1938, konstantin, 2007-10-16 10:53:56
|
68
|
+
* instance type support is set to default
|
69
|
+
|
70
|
+
== 1.4.3 2007-10-25
|
71
|
+
|
72
|
+
* r1983, konstantin, 2007-10-25 22:33:00 +0400
|
73
|
+
* Fixed ActiveSupport requirement bug (thanks to Toby)
|
74
|
+
* Fixed HttpConnection logging to stdout bug (thanks to Toby)
|
75
|
+
|
76
|
+
== 1.4.4
|
77
|
+
|
78
|
+
* r1999, tve, 2007-11-01 00:07:00 -0700
|
79
|
+
* Fixed escaping issue affecting key names in S3 gem
|
80
|
+
* Fixed duplicate marker in S3 incremental bucket listing
|
81
|
+
|
82
|
+
* r2001, konstantin, 2007-11-01 12:03:13 +0300
|
83
|
+
* Fixed multiple permissions assignment on Grantee#grant/revoke
|
84
|
+
* Fixed new grantee permissions set ingnore (Grantee#apply)
|
85
|
+
* S3::Grantee#exists? method added
|
86
|
+
|
87
|
+
* r2109, konstantin, 2007-11-12 21:49:36 +0300
|
88
|
+
* RightAwsBaseInterface: caching implemented.
|
89
|
+
(The Ec2 functions are being cached: describe_images, describe_instances,
|
90
|
+
describe_security_groups and describe_key_pairs)
|
91
|
+
|
92
|
+
== 1.4.5 - 1.4.6
|
93
|
+
* r 2619, konstantin, 01-17-08 16:18:36 +0300
|
94
|
+
* S3 Location constraints support added.
|
95
|
+
* Fixed bug with trailing '/' in the bucket name for 'EU' located buckets
|
96
|
+
* Added: S3Interface#bucket_location, S3::Bucket#location
|
97
|
+
|
98
|
+
== 1.4.7
|
99
|
+
* r 2622, konstantin, 01-18-08 13:52:20 +0300
|
100
|
+
* Virtual domains doc added
|
101
|
+
* S3 Query API fixed to support virtual domains.
|
102
|
+
|
103
|
+
== 1.4.8
|
104
|
+
* r 2650, konstantin, 01-24-08 11:12:00 +0300
|
105
|
+
* net_fix.rb moved to right_http_connection
|
106
|
+
|
107
|
+
== 1.5.0
|
108
|
+
* r 2688, konstantin, 02-30-08 15:42:00 +0300
|
109
|
+
* SDB support added.
|
110
|
+
* RightAws::S3::bucket and RightAws::S3::Bucket.create methods behaviour
|
111
|
+
changed: param +create+ is set to +false+ by default.
|
112
|
+
|
113
|
+
== 1.6.0
|
114
|
+
|
115
|
+
* r2780, todd, 2008-02-11 11:41:07 -0800 (Mon, 11 Feb 2008), 4 lines
|
116
|
+
* Some doc updates & tweaks: we now support ultra-large PUTs to S3, small SDB
|
117
|
+
cleanups, add SDB to the list of interfaces in RightAws, update some copyrights,
|
118
|
+
warn about loading attachment_fu AFTER right_aws (big no-no).
|
119
|
+
|
120
|
+
* r2784, todd, 2008-02-11 13:46:47 -0800 (Mon, 11 Feb 2008), 2 lines
|
121
|
+
* One final clarification: you may get a Net::HTTP bad monkey patch exception
|
122
|
+
|
123
|
+
* r2880, todd, 2008-02-25 18:06:22 -0800 (Mon, 25 Feb 2008), 2 lines
|
124
|
+
* Add SQS 'Gen 2' interface implementation
|
125
|
+
|
126
|
+
* r2913, todd, 2008-02-29 16:57:07 -0800 (Fri, 29 Feb 2008), 3 lines
|
127
|
+
* SqsGen2 (object interface), unit tests for both interfaces, documentation updates.
|
128
|
+
|
129
|
+
* r2922, todd, 2008-03-03 15:26:42 -0800 (Mon, 03 Mar 2008), 2 lines
|
130
|
+
* couple of documentation tweaks in prep for 1.6.0
|
131
|
+
|
132
|
+
== 1.6.1
|
133
|
+
|
134
|
+
* r2963, todd, 2008-03-06 19:10:23 -0800 (Thu, 06 Mar 2008), 3 lines
|
135
|
+
* (#950) Many minor fixes in incrementally_list_bucket to prevent a death loop
|
136
|
+
in certain rare conditions
|
137
|
+
|
138
|
+
== 1.7.0
|
139
|
+
|
140
|
+
* r3051, konstantin, 2008-03-14 21:26:12 +0300 (Fri, 14 Mar 2008), 1 line
|
141
|
+
* #897, ActiveSdb alpha release
|
142
|
+
|
143
|
+
== 1.7.1
|
144
|
+
|
145
|
+
Do not autoload right_sdb with the rest of the modules; it requires uuidtools.
|
146
|
+
We want the user to explicly request ActiveSdb, at least as long as it is
|
147
|
+
alpha/beta.
|
148
|
+
|
149
|
+
Fix escaping problem in SqsGen2Interface: POST bodies did not properly escape the '&' character
|
150
|
+
|
151
|
+
== 1.7.2
|
152
|
+
|
153
|
+
Release Notes:
|
154
|
+
|
155
|
+
RightAws includes some new features, including:
|
156
|
+
- Support in RightAws::S3 and RightAws::S3Interface for S3 key copy, move, and rename
|
157
|
+
- Support for signature version 0 request authentication to EC2, SQS, and SDB
|
158
|
+
- Enhanced S3 object meta-header read and update
|
159
|
+
- Interoperability with clouds running Eucalyptus (http://eucalyptus.cs.ucsb.edu)
|
160
|
+
[ Contributed by the Eucalyptus group ]
|
161
|
+
- Support for c1.medium and c1.xlarge instance types
|
162
|
+
|
163
|
+
Bug fixes include:
|
164
|
+
- Corrected the failure, under certain conditions, of retries of streaming PUTs to S3.
|
165
|
+
We now reset the seek pointer of the streaming IO object to its initial position.
|
166
|
+
- Removal of an accidental dependency on ActiveSupport in RightAws::S3Interface.get_link().
|
167
|
+
- Monkey-patch of the Ruby File class on Windows platforms to correct a problem in lstat.
|
168
|
+
The lstat bug was causing failure of very large file uploads on Windows [ Contributed by Benjamin Allfree ]
|
169
|
+
- Fixed parsing of the ETag field for S3 objects
|
170
|
+
|
171
|
+
|
172
|
+
|
data/Manifest.txt
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
README.txt
|
4
|
+
Rakefile
|
5
|
+
lib/awsbase/benchmark_fix.rb
|
6
|
+
lib/awsbase/file_fix.rb
|
7
|
+
lib/awsbase/right_awsbase.rb
|
8
|
+
lib/awsbase/support.rb
|
9
|
+
lib/ec2/right_ec2.rb
|
10
|
+
lib/right_aws.rb
|
11
|
+
lib/s3/right_s3.rb
|
12
|
+
lib/s3/right_s3_interface.rb
|
13
|
+
lib/sdb/active_sdb.rb
|
14
|
+
lib/sdb/right_sdb_interface.rb
|
15
|
+
lib/sqs/right_sqs.rb
|
16
|
+
lib/sqs/right_sqs_gen2.rb
|
17
|
+
lib/sqs/right_sqs_gen2_interface.rb
|
18
|
+
lib/sqs/right_sqs_interface.rb
|
19
|
+
test/ec2/test_helper.rb
|
20
|
+
test/ec2/test_right_ec2.rb
|
21
|
+
test/http_connection.rb
|
22
|
+
test/s3/test_helper.rb
|
23
|
+
test/s3/test_right_s3.rb
|
24
|
+
test/s3/test_right_s3_stubbed.rb
|
25
|
+
test/sdb/test_active_sdb.rb
|
26
|
+
test/sdb/test_helper.rb
|
27
|
+
test/sdb/test_right_sdb.rb
|
28
|
+
test/sqs/test_helper.rb
|
29
|
+
test/sqs/test_right_sqs.rb
|
30
|
+
test/sqs/test_right_sqs_gen2.rb
|
31
|
+
test/test_credentials.rb
|
32
|
+
test/ts_right_aws.rb
|
data/README.txt
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
= RightScale Amazon Web Services Ruby Gems
|
2
|
+
|
3
|
+
Published by RightScale, Inc. under the MIT License.
|
4
|
+
For information about RightScale, see http://www.rightscale.com
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
The RightScale AWS gems have been designed to provide a robust, fast, and secure interface to Amazon EC2, Amazon S3, Amazon SQS, and Amazon SDB. These gems have been used in production by RightScale since late 2006 and are being maintained to track enhancements made by Amazon. The RightScale AWS gems comprise:
|
9
|
+
|
10
|
+
- RightAws::Ec2 -- interface to Amazon EC2 (Elastic Compute Cloud)
|
11
|
+
- RightAws::S3 and RightAws::S3Interface -- interface to Amazon S3 (Simple Storage Service)
|
12
|
+
- RightAws::Sqs and RightAws::SqsInterface -- interface to first-generation Amazon SQS (Simple Queue Service) (API version 2007-05-01)
|
13
|
+
- RightAws::SqsGen2 and RightAws::SqsGen2Interface -- interface to second-generation Amazon SQS (Simple Queue Service) (API version 2008-01-01)
|
14
|
+
- RightAws::SdbInterface and RightAws::ActiveSdb -- interface to Amazon SDB (SimpleDB)
|
15
|
+
|
16
|
+
== FEATURES:
|
17
|
+
|
18
|
+
- Full programmmatic access to EC2, S3, SQS, and SDB.
|
19
|
+
- Complete error handling: all operations check for errors and report complete
|
20
|
+
error information by raising an AwsError.
|
21
|
+
- Persistent HTTP connections with robust network-level retry layer using
|
22
|
+
RightHttpConnection). This includes socket timeouts and retries.
|
23
|
+
- Robust HTTP-level retry layer. Certain (user-adjustable) HTTP errors returned
|
24
|
+
by Amazon's services are classified as temporary errors.
|
25
|
+
These errors are automaticallly retried using exponentially increasing intervals.
|
26
|
+
The number of retries is user-configurable.
|
27
|
+
- Fast REXML-based parsing of responses (as fast as a pure Ruby solution allows).
|
28
|
+
- Uses libxml (if available) for faster response parsing.
|
29
|
+
- Support for large S3 list operations. Buckets and key subfolders containing
|
30
|
+
many (> 1000) keys are listed in entirety. Operations based on list (like
|
31
|
+
bucket clear) work on arbitrary numbers of keys.
|
32
|
+
- Support for streaming GETs from S3, and streaming PUTs to S3 if the data source is a file.
|
33
|
+
- Support for single-threaded usage, multithreaded usage, as well as usage with multiple
|
34
|
+
AWS accounts.
|
35
|
+
- Support for both first- and second-generation SQS (API versions 2007-05-01
|
36
|
+
and 2008-01-01). These versions of SQS are not compatible.
|
37
|
+
- Support for signature versions 0 and 1 on SQS, SDB, and EC2.
|
38
|
+
- Interoperability with any cloud running Eucalyptus (http://eucalyptus.cs.ucsb.edu)
|
39
|
+
- Test suite (requires AWS account to do "live" testing).
|
40
|
+
|
41
|
+
== THREADING:
|
42
|
+
|
43
|
+
All RightScale AWS interfaces offer two threading options:
|
44
|
+
1. Use a single persistent HTTP connection per process.
|
45
|
+
2. Use a persistent HTTP connection per Ruby thread.
|
46
|
+
|
47
|
+
Either way, it doesn't matter how many (for example) RightAws::S3 objects you create,
|
48
|
+
they all use the same per-program or per-thread
|
49
|
+
connection. The purpose of sharing the connection is to keep a single
|
50
|
+
persistent HTTP connection open to avoid paying connection
|
51
|
+
overhead on every request. However, if you have multiple concurrent
|
52
|
+
threads, you may want or need an HTTP connection per thread to enable
|
53
|
+
concurrent requests to AWS. The way this plays out in practice is:
|
54
|
+
1. If you have a non-multithreaded Ruby program, use the non-multithreaded setting.
|
55
|
+
2. If you have a multi-threaded Ruby program, use the multithreaded setting to enable
|
56
|
+
concurrent requests to S3 (or SQS, or SDB, or EC2).
|
57
|
+
3. For running under Mongrel/Rails, use the non-multithreaded setting even though
|
58
|
+
mongrel is multithreaded. This is because only one Rails handler is invoked at
|
59
|
+
time (i.e. it acts like a single-threaded program)
|
60
|
+
|
61
|
+
Note that due to limitations in the I/O of the Ruby interpreter you
|
62
|
+
may not get the degree of parallelism you may expect with the multi-threaded setting.
|
63
|
+
|
64
|
+
By default, EC2/S3/SQS/SDB interface instances are created in single-threaded mode. Set
|
65
|
+
"params[:multi_thread]" to "true" in the initialization arguments to use
|
66
|
+
multithreaded mode.
|
67
|
+
|
68
|
+
== GETTING STARTED:
|
69
|
+
|
70
|
+
* For EC2 read RightAws::Ec2 and consult the Amazon EC2 API documentation at
|
71
|
+
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=87
|
72
|
+
* For S3 read RightAws::S3 and consult the Amazon S3 API documentation at
|
73
|
+
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=48
|
74
|
+
* For first generation SQS read RightAws::Sqs and consult the Amazon SQS API documentation at
|
75
|
+
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=31
|
76
|
+
* For second generation SQS read RightAws::SqsGen2, RightAws::SqsGen2Interface, and consult the Amazon SQS API documentation at
|
77
|
+
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1214&categoryID=31
|
78
|
+
|
79
|
+
Amazon's Migration Guide for moving from first to second generation SQS is
|
80
|
+
avalable at:
|
81
|
+
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1148
|
82
|
+
* For SDB read RightAws::SdbInterface, RightAws::ActiveSdb, and consult the Amazon SDB API documentation at
|
83
|
+
http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=141
|
84
|
+
|
85
|
+
== KNOWN ISSUES:
|
86
|
+
|
87
|
+
- Attempting to use the Gibberish plugin (used by the Beast forum app)
|
88
|
+
will break right_aws as well as lots of other code. Gibberish
|
89
|
+
changes the semantics of core Ruby (specifically, the String class) and thus presents a reliability
|
90
|
+
problem for most Ruby programs.
|
91
|
+
|
92
|
+
- 2/11/08: If you use RightAws in conjunction with attachment_fu, the
|
93
|
+
right_aws gem must be included (using the require statement) AFTER
|
94
|
+
attachment_fu. If right_aws is loaded before attachment_fu, you'll
|
95
|
+
encounter errors similar to:
|
96
|
+
|
97
|
+
s3.amazonaws.com temporarily unavailable: (wrong number of arguments (5 for 4))
|
98
|
+
|
99
|
+
or
|
100
|
+
|
101
|
+
'incompatible Net::HTTP monkey-patch'
|
102
|
+
|
103
|
+
This is due to a conflict between the right_http_connection gem and another
|
104
|
+
gem required by attachment_fu.
|
105
|
+
|
106
|
+
- 8/07: Amazon has changed the semantics of the SQS service. A
|
107
|
+
new queue may not be created within 60 seconds of the destruction of any
|
108
|
+
older queue with the same name. Certain methods of RightAws::Sqs and
|
109
|
+
RightAws::SqsInterface will fail with the message:
|
110
|
+
"AWS.SimpleQueueService.QueueDeletedRecently: You must wait 60 seconds after deleting a queue before you can create another with the same name."
|
111
|
+
|
112
|
+
== REQUIREMENTS:
|
113
|
+
|
114
|
+
RightAws requires REXML and the RightHttpConnection gem.
|
115
|
+
If libxml and its Ruby bindings (distributed in the libxml-ruby gem) are
|
116
|
+
present, RightAws can be configured to use them:
|
117
|
+
RightAws::RightAWSParser.xml_lib = 'libxml'
|
118
|
+
Any error with the libxml installation will result in RightAws failing-safe to
|
119
|
+
REXML parsing.
|
120
|
+
|
121
|
+
== INSTALL:
|
122
|
+
|
123
|
+
sudo gem install right_aws
|
124
|
+
|
125
|
+
== LICENSE:
|
126
|
+
|
127
|
+
Copyright (c) 2007-2008 RightScale, Inc.
|
128
|
+
|
129
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
130
|
+
a copy of this software and associated documentation files (the
|
131
|
+
'Software'), to deal in the Software without restriction, including
|
132
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
133
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
134
|
+
permit persons to whom the Software is furnished to do so, subject to
|
135
|
+
the following conditions:
|
136
|
+
|
137
|
+
The above copyright notice and this permission notice shall be
|
138
|
+
included in all copies or substantial portions of the Software.
|
139
|
+
|
140
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
141
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
142
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
143
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
144
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
145
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
146
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
require "rake/testtask"
|
6
|
+
require 'rcov/rcovtask'
|
7
|
+
$: << File.dirname(__FILE__)
|
8
|
+
require 'lib/right_aws.rb'
|
9
|
+
|
10
|
+
testglobs = ["test/ts_right_aws.rb"]
|
11
|
+
|
12
|
+
|
13
|
+
# Suppress Hoe's self-inclusion as a dependency for our Gem. This also keeps
|
14
|
+
# Rake & rubyforge out of the dependency list. Users must manually install
|
15
|
+
# these gems to run tests, etc.
|
16
|
+
class Hoe
|
17
|
+
def extra_deps
|
18
|
+
@extra_deps.reject do |x|
|
19
|
+
Array(x).first == 'hoe'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
Hoe.new('right_aws', RightAws::VERSION::STRING) do |p|
|
25
|
+
p.rubyforge_name = 'rightaws'
|
26
|
+
p.author = 'RightScale, Inc.'
|
27
|
+
p.email = 'support@rightscale.com'
|
28
|
+
p.summary = 'Interface classes for the Amazon EC2, SQS, and S3 Web Services'
|
29
|
+
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
|
30
|
+
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
|
31
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
32
|
+
p.remote_rdoc_dir = "/right_aws_gem_doc"
|
33
|
+
p.extra_deps = [['right_http_connection','>= 1.2.1']]
|
34
|
+
p.test_globs = testglobs
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Analyze code coverage of the unit tests."
|
38
|
+
Rcov::RcovTask.new do |t|
|
39
|
+
t.test_files = FileList[testglobs]
|
40
|
+
#t.verbose = true # uncomment to see the executed command
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Test just the SQS interface"
|
44
|
+
task :testsqs do
|
45
|
+
require 'test/test_credentials'
|
46
|
+
require 'test/http_connection'
|
47
|
+
TestCredentials.get_credentials
|
48
|
+
require 'test/sqs/test_right_sqs.rb'
|
49
|
+
end
|
50
|
+
|
51
|
+
desc "Test just the second generation SQS interface"
|
52
|
+
task :testsqs2 do
|
53
|
+
require 'test/test_credentials'
|
54
|
+
require 'test/http_connection'
|
55
|
+
TestCredentials.get_credentials
|
56
|
+
require 'test/sqs/test_right_sqs_gen2.rb'
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "Test just the S3 interface"
|
60
|
+
task :tests3 do
|
61
|
+
require 'test/test_credentials'
|
62
|
+
require 'test/http_connection'
|
63
|
+
TestCredentials.get_credentials
|
64
|
+
require 'test/s3/test_right_s3.rb'
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Test just the S3 interface using local stubs"
|
68
|
+
task :tests3local do
|
69
|
+
require 'test/test_credentials'
|
70
|
+
require 'test/http_connection'
|
71
|
+
TestCredentials.get_credentials
|
72
|
+
require 'test/s3/test_right_s3_stubbed.rb'
|
73
|
+
end
|
74
|
+
|
75
|
+
desc "Test just the EC2 interface"
|
76
|
+
task :testec2 do
|
77
|
+
require 'test/test_credentials'
|
78
|
+
TestCredentials.get_credentials
|
79
|
+
require 'test/ec2/test_right_ec2.rb'
|
80
|
+
end
|
81
|
+
|
82
|
+
desc "Test just the SDB interface"
|
83
|
+
task :testsdb do
|
84
|
+
require 'test/test_credentials'
|
85
|
+
TestCredentials.get_credentials
|
86
|
+
require 'test/sdb/test_right_sdb.rb'
|
87
|
+
end
|
88
|
+
|
89
|
+
desc "Test active SDB interface"
|
90
|
+
task :testactivesdb do
|
91
|
+
require 'test/test_credentials'
|
92
|
+
TestCredentials.get_credentials
|
93
|
+
require 'test/sdb/test_active_sdb.rb'
|
94
|
+
end
|
95
|
+
|
96
|
+
# vim: syntax=Ruby
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2007-2008 RightScale Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#
|
23
|
+
#
|
24
|
+
|
25
|
+
|
26
|
+
# A hack because there's a bug in add! in Benchmark::Tms
|
27
|
+
module Benchmark #:nodoc:
|
28
|
+
class Tms #:nodoc:
|
29
|
+
def add!(&blk)
|
30
|
+
t = Benchmark::measure(&blk)
|
31
|
+
@utime = utime + t.utime
|
32
|
+
@stime = stime + t.stime
|
33
|
+
@cutime = cutime + t.cutime
|
34
|
+
@cstime = cstime + t.cstime
|
35
|
+
@real = real + t.real
|
36
|
+
self
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (c) 2007-2008 RightScale Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
# File.lstat.size doesn't report large sizes correctly in Ruby 1.8 (Windows).
|
26
|
+
if RUBY_PLATFORM[/mswin|mingw|bccwin|wince/i]
|
27
|
+
require 'win32/file'
|
28
|
+
class File
|
29
|
+
def lstat
|
30
|
+
self.stat
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|