s3cp 1.1.0.pre.2 → 1.1.0.pre.3

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 CHANGED
@@ -1,4 +1,10 @@
1
- === 1.1.0.pre.2 / (Pending)
1
+ === 1.1.0.pre.3 / (2012-08-22)
2
+
3
+ * Fixed: s3cp >5GB file uploads (Peter Tan)
4
+
5
+ * Changed: Updated aws-sdk dependency to ~> 1.6.3
6
+
7
+ === 1.1.0.pre.2 / (2012-08-08)
2
8
 
3
9
  * Added: 's3cp --version' now reports version information.
4
10
 
data/lib/s3cp/s3cp.rb CHANGED
@@ -155,18 +155,25 @@ if options[:debug]
155
155
  puts "Options: \n#{options.inspect}"
156
156
  end
157
157
 
158
- class Proxy
158
+ class ProxyIO
159
159
  instance_methods.each { |m| undef_method m unless m =~ /(^__|^send$|^object_id$)/ }
160
160
 
161
- def initialize(target)
162
- @target = target
161
+ def initialize(io, progress_bar)
162
+ @io = io
163
+ @progress_bar = progress_bar
164
+ end
165
+
166
+ def read(size)
167
+ result = @io.read(size)
168
+ @progress_bar.inc result.length if result
169
+ result
163
170
  end
164
171
 
165
172
  protected
166
173
 
167
174
  def method_missing(name, *args, &block)
168
- #puts "method_missing! #{name} #{args.inspect}"
169
- @target.send(name, *args, &block)
175
+ #puts "ProxyIO method_missing! #{name} #{args.inspect}"
176
+ @io.send(name, *args, &block)
170
177
  end
171
178
  end
172
179
 
@@ -288,10 +295,7 @@ def local_to_s3(bucket_to, key, file, options = {})
288
295
  end
289
296
 
290
297
  begin
291
- s3_options = {
292
- :bucket_name => bucket_to,
293
- :key => key
294
- }
298
+ s3_options = {}
295
299
  S3CP.set_header_options(s3_options, @headers)
296
300
  s3_options[:acl] = options[:acl]
297
301
  s3_options[:content_length] = File.size(file)
@@ -300,14 +304,9 @@ def local_to_s3(bucket_to, key, file, options = {})
300
304
  p.file_transfer_mode
301
305
  end
302
306
 
303
- meta = @s3.client.put_object(s3_options) do |buffer|
304
- File.open(file) do |io|
305
- while !io.eof?
306
- result = io.read(32 * 1024)
307
- progress_bar.inc result.length if result
308
- buffer.write(result)
309
- end
310
- end
307
+ File.open(file) do |io|
308
+ obj = @s3.buckets[bucket_to].objects[key]
309
+ obj.write(ProxyIO.new(io, progress_bar), s3_options)
311
310
  end
312
311
 
313
312
  progress_bar.finish if progress_bar
data/lib/s3cp/version.rb CHANGED
@@ -16,5 +16,5 @@
16
16
  # the License.
17
17
 
18
18
  module S3CP
19
- VERSION = "1.1.0.pre.2"
19
+ VERSION = "1.1.0.pre.3"
20
20
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3cp
3
3
  version: !ruby/object:Gem::Version
4
- hash: -3585171968
4
+ hash: 3125656313
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
9
  - 0
10
10
  - pre
11
- - 2
12
- version: 1.1.0.pre.2
11
+ - 3
12
+ version: 1.1.0.pre.3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Alex Boisvert
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-08-09 00:00:00 Z
20
+ date: 2012-08-22 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  prerelease: false
@@ -58,12 +58,12 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- hash: 13
61
+ hash: 9
62
62
  segments:
63
63
  - 1
64
- - 5
65
- - 7
66
- version: 1.5.7
64
+ - 6
65
+ - 3
66
+ version: 1.6.3
67
67
  requirement: *id003
68
68
  type: :runtime
69
69
  - !ruby/object:Gem::Dependency