s3cp 1.1.16 → 1.1.17
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 +4 -0
- data/lib/s3cp/#Untitled-5# +5 -0
- data/lib/s3cp/s3cp.rb +1 -1
- data/lib/s3cp/s3du.rb +30 -18
- data/lib/s3cp/version.rb +1 -1
- metadata +5 -4
data/History.txt
CHANGED
data/lib/s3cp/s3cp.rb
CHANGED
@@ -478,7 +478,7 @@ def copy(from, to, options)
|
|
478
478
|
end
|
479
479
|
end
|
480
480
|
else
|
481
|
-
key_to += File.basename(
|
481
|
+
key_to += File.basename(from) if key_to[-1..-1] == "/"
|
482
482
|
local_to_s3(bucket_to, key_to, File.expand_path(from), options) unless !options[:overwrite] && s3_exist?(bucket_to, key_to)
|
483
483
|
end
|
484
484
|
when :s3_to_local
|
data/lib/s3cp/s3du.rb
CHANGED
@@ -95,27 +95,39 @@ def print(key, size)
|
|
95
95
|
end
|
96
96
|
|
97
97
|
begin
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
98
|
+
s3_options = Hash.new
|
99
|
+
s3_options[:bucket_name] = @bucket
|
100
|
+
s3_options[:prefix] = @prefix
|
101
|
+
|
102
|
+
begin
|
103
|
+
response = @s3.client.list_objects(s3_options)
|
104
|
+
response[:contents].each do |object|
|
105
|
+
|
106
|
+
key = object[:key]
|
107
|
+
size = object[:size].to_i
|
108
|
+
|
109
|
+
if options[:regex].nil? || options[:regex].match(key)
|
110
|
+
current_key = if actual_depth
|
111
|
+
pos = nth_occurrence(key, "/", actual_depth)
|
112
|
+
(pos != -1) ? key[0..pos-1] : key
|
113
|
+
end
|
114
|
+
|
115
|
+
if (last_key && last_key != current_key)
|
116
|
+
print(last_key, subtotal_size)
|
117
|
+
subtotal_size = size
|
118
|
+
else
|
119
|
+
subtotal_size += size
|
120
|
+
end
|
121
|
+
|
122
|
+
last_key = current_key
|
123
|
+
total_size += size
|
106
124
|
end
|
125
|
+
end
|
107
126
|
|
108
|
-
|
109
|
-
print(last_key, subtotal_size)
|
110
|
-
subtotal_size = size
|
111
|
-
else
|
112
|
-
subtotal_size += size
|
113
|
-
end
|
127
|
+
break if response[:contents].empty?
|
114
128
|
|
115
|
-
|
116
|
-
|
117
|
-
end
|
118
|
-
end
|
129
|
+
s3_options.merge!(:marker => response[:contents].last[:key])
|
130
|
+
end while response[:truncated]
|
119
131
|
|
120
132
|
if last_key != nil
|
121
133
|
print(last_key, subtotal_size)
|
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: 49
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 17
|
10
|
+
version: 1.1.17
|
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-02-05 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -138,6 +138,7 @@ extra_rdoc_files:
|
|
138
138
|
files:
|
139
139
|
- lib/s3cp/s3cat.rb
|
140
140
|
- lib/s3cp/s3tree.rb
|
141
|
+
- lib/s3cp/#Untitled-5#
|
141
142
|
- lib/s3cp/s3ls.rb
|
142
143
|
- lib/s3cp/s3du.rb
|
143
144
|
- lib/s3cp/s3mod.rb
|