lib/io_streams/zip/reader.rb in iostreams-0.8.2 vs lib/io_streams/zip/reader.rb in iostreams-0.9.0
- old
+ new
@@ -16,10 +16,10 @@
options = options.dup
buffer_size = options.delete(:buffer_size) || 65536
raise(ArgumentError, "Unknown IOStreams::Zip::Reader option: #{options.inspect}") if options.size > 0
# File name supplied
- return read_file(file_name_or_io, &block) unless file_name_or_io.respond_to?(:read)
+ return read_file(file_name_or_io, &block) unless IOStreams.reader_stream?(file_name_or_io)
# Stream supplied
begin
# Since ZIP cannot be streamed, download un-zipped data to a local file before streaming
temp_file = Tempfile.new('rocket_job')