yam-aws-s3 0.6.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,105 @@
1
+ head:
2
+
3
+ 0.6.2:
4
+
5
+ - Apparently need to use custom __method__ in Ruby versions right up to 1.8.7.
6
+
7
+ 0.6.1:
8
+
9
+ - Use custom __method__ in Ruby versions *prior* to 1.8.7 not *up to* 1.8.7.
10
+
11
+ - Rename Kernel#memoize to Kernel#expirable_memoize so that it doesn't conflict with memoize method in ActiveSupport which has an entirely different API and semantics. Reported by [Florian Dütsc (mail@florian-duetsch.de)].
12
+
13
+ 0.6.0:
14
+
15
+ - Full 1.9 compatibility (all tests passing against 1.9 & 1.8.6). Thanks to [David (dvdplm@gmail.com), Cyril David (cyx.ucron@gmail.com)]
16
+
17
+ 0.5.1:
18
+
19
+ - For now just redefine __method__ to take arguments so we don't break 1.8.7 use today
20
+
21
+ 0.5.0:
22
+
23
+ - Bug #17458 fixed. Normalize the :expires_in option to always be an integer even if the actual object passed in is a proxy to an integer, such as is the case with 2.hours from ActiveSupport which is actually an instance of ActiveSupport::Duration. Reported by [Steve Kickert steve@riverocktech.com]
24
+
25
+ - Bug #19158 fixed. Don't prepend leading slash onto bucket name when deleting a bucket with the :force => true option.
26
+
27
+ - Bug #17628 fixed. Don't ignore :use_ssl => false in url_for when the connection is established over ssl. Reported by [Tom Fixed (tkat11)]
28
+
29
+ - Bug #13052 fixed. Appease some proxies by always including a Content-Length with all requests. Reported by [James Murty (jmurty)]
30
+
31
+ - Bug #13756 fixed. Attributes that are false should not raise NoMethodError in Base#method_missing. Fixed by [Scott Patten]
32
+
33
+ - Bug #19189 fixed. No longer reference Date::ABBR_MONTHS constant which was removed in Ruby 1.8.6. Reported by [Khurram Virani (kvirani)]
34
+
35
+ - Bug #20487 fixed. If a request fails and is retried, only escape the request path the first time. Reported by [anonymous]
36
+
37
+ - Replace ad-hoc S3Object.copy method with newly support built in API call.
38
+
39
+ - Do not make connections persistent by default. This "feature" causes far more broken pipes than it is worth. Use with caution.
40
+
41
+ 0.4.0:
42
+
43
+ - Various adjustments to connection handling to try to mitigate exceptions raised from deep within Net::HTTP.
44
+
45
+ - Don't coerce numbers that start with a zero because the zero will be lost. If a bucket, for example, has a name like '0815', all operation it will fail. Closes ticket #10089 [reported anonymously]"
46
+
47
+ - Add ability to connect through a proxy using the :proxy option when establishing a connection. Suggested by [Simon Horne <simon@soulware.co.uk>]
48
+
49
+ - Add :authenticated option to url_for. When passing false, don't generate signature parameters for query string.
50
+
51
+ - Make url_for accept custom port settings. [Rich Olson]
52
+
53
+ 0.3.0:
54
+
55
+ - Ensure content type is eventually set to account for changes made to Net::HTTP in Ruby version 1.8.5. Reported by [David Hanson, Stephen Caudill, Tom Mornini <tmornini@engineyard.com>]
56
+
57
+ - Add :persistent option to connections which keeps a persistent connection rather than creating a new one per request, defaulting to true. Based on a patch by [Metalhead <metalhead@metalhead.ws>]
58
+
59
+ - If we are retrying a request after rescuing one of the retry exceptions, rewind the body if its an IO stream so it starts at the beginning. [Jamis Buck]
60
+
61
+ - Ensure that all paths being submitted to S3 are valid utf8. If they are not, we remove the extended characters. Ample help from [Jamis Buck]
62
+
63
+ - Wrap logs in Log objects which exposes each line as a Log::Line that has accessors by name for each field.
64
+
65
+ - Various performance optimizations for the extensions code. [Roman LE NEGRATE <roman2k@free.fr>]
66
+
67
+ - Make S3Object.copy more efficient by streaming in both directions in parallel.
68
+
69
+ - Open up Net:HTTPGenericRequest to make the chunk size 1 megabyte, up from 1 kilobyte.
70
+
71
+ - Add S3Object.exists?
72
+
73
+ 0.2.1:
74
+
75
+ - When the bucket name argument (for e.g. Bucket.objects) is being used as the option hash, reassign it to the options variable and set the bucket to nil so bucket inference + options works.
76
+
77
+ - Don't call CGI.escape on query string parameters in Hash#to_query_string since all paths get passed through URI.escape right before the request is made. Paths were getting double escaped. Bug spotted by [David Hanson]
78
+
79
+ - Make s3sh exec irb.bat if on Windows. Bug spotted by [N. Sathish Kumar <nsathishk@yahoo.com>]
80
+
81
+ - Avoid class_variable_(get|set) since it was only recently added to Ruby. Spotted by [N. Sathish Kumar <nsathishk@yahoo.com>]
82
+
83
+ - Raise NoSuchKey if S3Object.about requests a key that does not exist.
84
+
85
+ - If the response body is an empty string, don't try to parse it as xml.
86
+
87
+ - Don't reject every body type save for IO and String at the door when making a request. Suggested by [Alex MacCaw <maccman@gmail.com>]
88
+
89
+ - Allow dots in bucket names. [Jesse Newland]
90
+
91
+ 0.2.0:
92
+
93
+ - Infer content type for an object when calling S3Object.store without explicitly passing in the :content_type option.
94
+
95
+ 0.1.2:
96
+
97
+ - Scrap (overly) fancy generator based version of CoercibleString with a much simpler and clearer case statement. Continuations are really slow and the specific use of the generator was leaking memory. Bug spotted by [Remco van't Veer]
98
+
99
+ 0.1.1:
100
+
101
+ - Don't add the underscore method to String if it is already defined (like, for example, from ActiveSupport). Bug spotted by [Matt White <stockliasteroid@gmail.com>]
102
+
103
+ 0.1.0:
104
+
105
+ - Initial public release
data/COPYING ADDED
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright (c) 2006-2009 Marcel Molina Jr. <marcel@vernix.org>
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ # this software and associated documentation files (the "Software"), to deal in the
6
+ # Software without restriction, including without limitation the rights to use,
7
+ # copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ # Software, and to permit persons to whom the Software is furnished to do so,
9
+ # subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ # FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17
+ # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18
+ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/INSTALL ADDED
@@ -0,0 +1,55 @@
1
+ == Rubygems
2
+
3
+ The easiest way to install aws/s3 is with Rubygems:
4
+
5
+ % sudo gem i aws-s3 -ry
6
+
7
+ == Directly from svn
8
+
9
+ % svn co svn://rubyforge.org/var/svn/amazon/s3/trunk aws
10
+
11
+ == As a Rails plugin
12
+
13
+ If you want to use aws/s3 with a Rails application, you can export the repository
14
+ into your plugins directory and then check it in:
15
+
16
+ % cd my-rails-application/vendor/plugins
17
+ % svn export svn://rubyforge.org/var/svn/amazon/s3/trunk aws
18
+ % svn add aws
19
+
20
+ Or you could pull it down with an svn:externals:
21
+
22
+ % cd my-rails-application/vendor/plugins
23
+ % svn propedit svn:externals .
24
+
25
+ Then add the following line, save and exit:
26
+
27
+ aws svn://rubyforge.org/var/svn/amazon/s3/trunk
28
+
29
+ If you go the svn route, be sure that you have all the dependencies installed. The list of dependencies follow.
30
+
31
+ == Dependencies
32
+
33
+ AWS::S3 requires Ruby 1.8.4 or greater.
34
+
35
+ It also has the following dependencies:
36
+
37
+ sudo gem i xml-simple -ry
38
+ sudo gem i builder -ry
39
+ sudo gem i mime-types -ry
40
+
41
+ === XML parsing (xml-simple)
42
+
43
+ AWS::S3 depends on XmlSimple (http://xml-simple.rubyforge.org/). When installing aws/s3 with
44
+ Rubygems, this dependency will be taken care of for you. Otherwise, installation instructions are listed on the xml-simple
45
+ site.
46
+
47
+ If your system has the Ruby libxml bindings installed (http://libxml.rubyforge.org/) they will be used instead of REXML (which is what XmlSimple uses). For those concerned with speed and efficiency, it would behoove you to install libxml (instructions here: http://libxml.rubyforge.org/install.html) as it is considerably faster and less expensive than REXML.
48
+
49
+ === XML generation (builder)
50
+
51
+ AWS::S3 also depends on the Builder library (http://builder.rubyforge.org/ and http://rubyforge.org/projects/builder/). This will also automatically be installed for you when using Rubygems.
52
+
53
+ === Content type inference (mime-types)
54
+
55
+ AWS::S3 depends on the MIME::Types library (http://mime-types.rubyforge.org/) to infer the content type of an object that does not explicitly specify it. This library will automatically be installed for you when using Rubygems.
data/README.erb ADDED
@@ -0,0 +1,58 @@
1
+ = AWS::S3
2
+
3
+ <%= docs_for['AWS::S3'] %>
4
+
5
+ == AWS::S3 Basics
6
+ === The service, buckets and objects
7
+
8
+ The three main concepts of S3 are the service, buckets and objects.
9
+
10
+ ==== The service
11
+
12
+ <%= docs_for['AWS::S3::Service'] %>
13
+
14
+ ==== Buckets
15
+
16
+ <%= docs_for['AWS::S3::Bucket'] %>
17
+
18
+ ==== Objects
19
+
20
+ <%= docs_for['AWS::S3::S3Object'] %>
21
+
22
+ ==== Streaming uploads
23
+
24
+ <%= docs_for['AWS::S3::S3Object::store'] %>
25
+
26
+ == Setting the current bucket
27
+ ==== Scoping operations to a specific bucket
28
+
29
+ <%= docs_for['AWS::S3::Base.set_current_bucket_to'] %>
30
+
31
+ == BitTorrent
32
+ ==== Another way to download large files
33
+
34
+ <%= docs_for['AWS::S3::BitTorrent'] %>
35
+
36
+ == Access control
37
+ ==== Using canned access control policies
38
+
39
+ <%= docs_for['AWS::S3::ACL'] %>
40
+
41
+ ==== Accessing private objects from a browser
42
+
43
+ <%= docs_for['AWS::S3::S3Object.url_for'] %>
44
+
45
+ == Logging
46
+ ==== Tracking requests made on a bucket
47
+
48
+ <%= docs_for['AWS::S3::Logging'] %>
49
+
50
+ == Errors
51
+ ==== When things go wrong
52
+
53
+ <%= docs_for['AWS::S3::Error'] %>
54
+
55
+ ==== Accessing the last request's response
56
+
57
+ <%= docs_for['AWS::S3::Service.response'] %>
58
+
data/bin/s3sh ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ s3_lib = File.dirname(__FILE__) + '/../lib/aws/s3'
3
+ setup = File.dirname(__FILE__) + '/setup'
4
+ irb_name = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
5
+
6
+ exec "#{irb_name} -r #{s3_lib} -r #{setup} --simple-prompt"
data/bin/setup.rb ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ if ENV['AMAZON_ACCESS_KEY_ID'] && ENV['AMAZON_SECRET_ACCESS_KEY']
3
+ AWS::S3::Base.establish_connection!(
4
+ :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
5
+ :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY']
6
+ )
7
+ end
8
+
9
+ require File.dirname(__FILE__) + '/../test/fixtures'
10
+ include AWS::S3