Make File.open_buffer support Tempfiles

This commit is contained in:
Jim Ryan 2013-12-02 18:57:42 -05:00
parent 3917dedbb5
commit 0f8ce2cbb8
1 changed files with 2 additions and 2 deletions

View File

@ -117,8 +117,8 @@ module Zip
# (This can be used to extract data from a
# downloaded zip archive without first saving it to disk.)
def open_buffer(io, options = {})
unless io.is_a?(IO) || io.is_a?(String)
raise "Zip::File.open_buffer expects an argument of class String or IO. Found: #{io.class}"
unless io.is_a?(IO) || io.is_a?(String) || io.is_a?(Tempfile)
raise "Zip::File.open_buffer expects an argument of class String, IO, or Tempfile. Found: #{io.class}"
end
zf = ::Zip::File.new('', true, true, options)
if io.is_a?(::String)