s3cp 1.1.27 → 1.1.28
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/History.txt +6 -0
- data/lib/s3cp/s3buckets.rb +21 -3
- data/lib/s3cp/version.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 1.1.28 (2013-05-07)
|
2
|
+
|
3
|
+
* Added: s3buckets command may not be used to create buckets.
|
4
|
+
|
5
|
+
% S3CP_REGION="eu-west-1" s3buckets --create super-bucket --acl public_read
|
6
|
+
|
1
7
|
=== 1.1.27 (2013-04-04)
|
2
8
|
|
3
9
|
* Fixed: Fixed [NoMethodError] undefined method 'exist?' in s3cp when using
|
data/lib/s3cp/s3buckets.rb
CHANGED
@@ -31,6 +31,14 @@ op = OptionParser.new do |opts|
|
|
31
31
|
options[:debug] = true
|
32
32
|
end
|
33
33
|
|
34
|
+
opts.on("--create BUCKET_NAME", "Create bucket") do |bucket|
|
35
|
+
options[:create] = bucket
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on("--acl ACL", "ACL of new bucket. e.g., private, public_read, public_read_write, authenticated_read, log_delivery_write") do |acl|
|
39
|
+
options[:acl] = acl
|
40
|
+
end
|
41
|
+
|
34
42
|
opts.on_tail("-h", "--help", "Show this message") do
|
35
43
|
puts op
|
36
44
|
exit
|
@@ -40,10 +48,20 @@ op.parse!(ARGV)
|
|
40
48
|
|
41
49
|
S3CP.load_config()
|
42
50
|
|
51
|
+
s3 = S3CP.connect()
|
43
52
|
begin
|
44
|
-
|
45
|
-
|
46
|
-
|
53
|
+
if options[:create]
|
54
|
+
name = options[:create]
|
55
|
+
create_options = {}
|
56
|
+
create_options[:acl] = options[:acl] if options[:acl]
|
57
|
+
p "options #{create_options.inspect}"
|
58
|
+
puts "Creating bucket #{name} ..."
|
59
|
+
s3.buckets.create(name, create_options)
|
60
|
+
puts "Bucket #{name} created."
|
61
|
+
else
|
62
|
+
s3.buckets.each do |bucket|
|
63
|
+
puts bucket.name
|
64
|
+
end
|
47
65
|
end
|
48
66
|
rescue => e
|
49
67
|
$stderr.print "s3buckets: [#{e.class}] #{e.message}\n"
|
data/lib/s3cp/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3cp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 43
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 28
|
10
|
+
version: 1.1.28
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Boisvert
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-05-07 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|