s3 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +11 -44
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/lib/s3/bucket.rb +1 -1
- data/test/bucket_test.rb +4 -4
- metadata +25 -5
data/README.rdoc
CHANGED
@@ -1,59 +1,26 @@
|
|
1
1
|
= S3
|
2
2
|
|
3
|
-
S3 library provides access to Amazon's Simple Storage Service.
|
4
|
-
supports both: European and US buckets through REST API.
|
3
|
+
S3 library provides access to {Amazon's Simple Storage Service}[http://aws.amazon.com/s3/].
|
4
|
+
It supports both: European and US buckets through {REST API}[http://docs.amazonwebservices.com/AmazonS3/latest/RESTAPI.html].
|
5
5
|
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
6
|
+
* homepage[http://jah.pl/projects/s3.html]
|
7
|
+
* gemcutter[http://gemcutter.org/gems/s3]
|
8
|
+
* repository[http://github.com/qoobaa/s3]
|
9
|
+
* {issue tracker}[http://github.com/qoobaa/s3/issues]
|
10
|
+
* rdoc[http://qoobaa.github.com/s3]
|
9
11
|
|
10
12
|
== Installation
|
11
13
|
|
12
|
-
If you don't have the Gemcutter sources yet:
|
14
|
+
If you don't have the {Gemcutter sources}[http://gemcutter.org/pages/gem_docs] yet:
|
13
15
|
gem sources -a http://gemcutter.org
|
14
16
|
|
15
17
|
To install the gem type:
|
16
|
-
|
18
|
+
gem install s3
|
17
19
|
|
18
20
|
== Usage
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
== Command tool usage
|
23
|
-
|
24
|
-
You have to pass access key id (-a) and secret access key (-s) to the
|
25
|
-
command line tool. S3 reads ACCESS_KEY_ID and SECRET_ACCESS_KEY
|
26
|
-
environment variables and uses them by default, so if you don't want
|
27
|
-
to pass them each time, export them (e.g. in ~/.bashrc file).
|
28
|
-
|
29
|
-
* list buckets
|
30
|
-
s3 bucket
|
31
|
-
|
32
|
-
* create bucket
|
33
|
-
s3 bucket add name-of-bucket
|
34
|
-
|
35
|
-
* list objects in bucket
|
36
|
-
s3 bucket show name-of-bucket
|
37
|
-
|
38
|
-
* destroy bucket
|
39
|
-
s3 bucket remove name-of-bucket
|
40
|
-
|
41
|
-
* list objects (in all buckets)
|
42
|
-
s3 object
|
43
|
-
|
44
|
-
* show the object information
|
45
|
-
s3 object show bucket_name/path/to/object.extension
|
46
|
-
|
47
|
-
* download the content of the object
|
48
|
-
s3 object show bucket_name/path/to/object.extension filename_to_store_the_content.extension
|
49
|
-
|
50
|
-
* show the content of the object to STDOUT
|
51
|
-
s3 object show bucket_name/path/to/object.extension -
|
52
|
-
|
53
|
-
You can also pass --help to the commmands like:
|
54
|
-
s3 bucket add --help
|
55
|
-
s3 object show --help
|
22
|
+
See homepage[http://jah.pl/projects/s3.html] for details.
|
56
23
|
|
57
24
|
== Copyright
|
58
25
|
|
59
|
-
Copyright (c) 2009 Jakub Kuźma, Mirosław Boruta. See LICENSE for details.
|
26
|
+
Copyright (c) 2009 Jakub Kuźma, Mirosław Boruta. See LICENSE[http://github.com/qoobaa/s3/raw/master/LICENSE] for details.
|
data/Rakefile
CHANGED
@@ -12,6 +12,8 @@ begin
|
|
12
12
|
gem.homepage = "http://jah.pl/projects/s3.html"
|
13
13
|
gem.authors = ["Jakub Kuźma", "Mirosław Boruta"]
|
14
14
|
gem.add_dependency "trollop", ">=1.14"
|
15
|
+
gem.add_development_dependency "test-unit", ">= 2.0"
|
16
|
+
gem.add_development_dependency "rr", "=0.10.2"
|
15
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
18
|
end
|
17
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/s3/bucket.rb
CHANGED
@@ -180,7 +180,7 @@ module S3
|
|
180
180
|
end
|
181
181
|
|
182
182
|
def name_valid?(name)
|
183
|
-
name =~ /\A[a-z0-9][a-z0-9\._-]{2,254}\Z/ and name !~ /\A#{URI::REGEXP::PATTERN::IPV4ADDR}\Z/
|
183
|
+
name =~ /\A[a-z0-9][a-z0-9\._-]{2,254}\Z/i and name !~ /\A#{URI::REGEXP::PATTERN::IPV4ADDR}\Z/
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
data/test/bucket_test.rb
CHANGED
@@ -2,8 +2,8 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class BucketTest < Test::Unit::TestCase
|
4
4
|
def setup
|
5
|
-
@bucket_vhost = S3::Bucket.send(:new, nil, "
|
6
|
-
@bucket_path = S3::Bucket.send(:new, nil, "
|
5
|
+
@bucket_vhost = S3::Bucket.send(:new, nil, "Data-Bucket")
|
6
|
+
@bucket_path = S3::Bucket.send(:new, nil, "Data_Bucket")
|
7
7
|
@bucket = @bucket_vhost
|
8
8
|
|
9
9
|
@response_location = Net::HTTPOK.new("1.1", "200", "OK")
|
@@ -65,13 +65,13 @@ class BucketTest < Test::Unit::TestCase
|
|
65
65
|
actual = @bucket_vhost.path_prefix
|
66
66
|
assert_equal expected, actual
|
67
67
|
|
68
|
-
expected = "
|
68
|
+
expected = "Data_Bucket/"
|
69
69
|
actual = @bucket_path.path_prefix
|
70
70
|
assert_equal expected, actual
|
71
71
|
end
|
72
72
|
|
73
73
|
def test_host
|
74
|
-
expected = "
|
74
|
+
expected = "Data-Bucket.s3.amazonaws.com"
|
75
75
|
actual = @bucket_vhost.host
|
76
76
|
assert_equal expected, actual
|
77
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Jakub Ku\xC5\xBAma"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2010-01-04 00:00:00 +01:00
|
14
14
|
default_executable: s3
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -23,6 +23,26 @@ dependencies:
|
|
23
23
|
- !ruby/object:Gem::Version
|
24
24
|
version: "1.14"
|
25
25
|
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: test-unit
|
28
|
+
type: :development
|
29
|
+
version_requirement:
|
30
|
+
version_requirements: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "2.0"
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rr
|
38
|
+
type: :development
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 0.10.2
|
45
|
+
version:
|
26
46
|
description:
|
27
47
|
email: qoobaa@gmail.com
|
28
48
|
executables:
|
@@ -88,8 +108,8 @@ specification_version: 3
|
|
88
108
|
summary: Library for accessing S3 objects and buckets, with command line tool
|
89
109
|
test_files:
|
90
110
|
- test/bucket_test.rb
|
91
|
-
- test/
|
111
|
+
- test/object_test.rb
|
92
112
|
- test/signature_test.rb
|
93
|
-
- test/
|
113
|
+
- test/service_test.rb
|
94
114
|
- test/test_helper.rb
|
95
|
-
- test/
|
115
|
+
- test/connection_test.rb
|