lib/io_streams/paths/s3.rb in iostreams-1.0.0.beta7 vs lib/io_streams/paths/s3.rb in iostreams-1.0.0

- old
+ new

@@ -206,16 +206,16 @@ end # TODO: delete_all # Read from AWS S3 file. - def reader(&block) + def stream_reader(&block) # Since S3 download only supports a push stream, write it to a tempfile first. Utils.temp_file_name("iostreams_s3") do |file_name| read_file(file_name) - ::File.open(file_name, "rb") { |io| streams.reader(io, &block) } + ::File.open(file_name, "rb") { |io| builder.reader(io, &block) } end end # Shortcut method if caller has a filename already with no other streams applied: def read_file(file_name) @@ -229,13 +229,13 @@ # Raises [MultipartUploadError] If an object is being uploaded in # parts, and the upload can not be completed, then the upload is # aborted and this error is raised. The raised error has a `#errors` # method that returns the failures that caused the upload to be # aborted. - def writer(&block) + def stream_writer(&block) # Since S3 upload only supports a pull stream, write it to a tempfile first. Utils.temp_file_name("iostreams_s3") do |file_name| - result = ::File.open(file_name, "wb") { |io| streams.writer(io, &block) } + result = ::File.open(file_name, "wb") { |io| builder.writer(io, &block) } # Upload file only once all data has been written to it write_file(file_name) result end