vendor/bundle/ruby/2.7.0/gems/rubyzip-2.3.0/lib/zip/file.rb
# Like #open, but reads zip archive contents from a String or open IO
# stream, and outputs data to a buffer.
# (This can be used to extract data from a
# downloaded zip archive without first saving it to disk.)
Like #open, but reads zip archive contents from a String or open IO
stream, and outputs data to a buffer.
(This can be used to extract data from a
downloaded zip archive without first saving it to disk.)
Like #open but reads zip archive contents from a String or open IO stream and outputs data to a buffer . ( 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_METHODS.map { |method| io.respond_to?(method) }.all? || io.kind_of?(String)
          raise "Zip::File.open_buffer expects a String or IO-like argument (responds to #{IO_METHODS.join(', ')}). Found: #{io.class}"
        end
        io = ::StringIO.new(io) if io.kind_of?(::String)
        io.binmode if io.respond_to?(:binmode)
        zf = ::Zip::File.new(io, true, true, options)
        return zf unless block_given?
        yield zf
        begin
          zf.write_buffer(io)
        rescue IOError => e
          raise unless e.message == 'not opened for writing'
        end
      end
def open_buffer ( io , options = { } ) unless IO_METHODS . map { | method | io . respond_to? ( method ) } . all? || io . kind_of? ( String ) raise "Zip::File.open_buffer expects a String or IO-like argument (responds to #{IO_METHODS.join(', ')}). Found: #{io.class}" end io = :: StringIO . new ( io ) if io . kind_of? ( :: String ) io . binmode if io . respond_to? ( :binmode ) zf = :: Zip :: File . new ( io , true , true , options ) return zf unless block_given? yield zf begin zf . write_buffer ( io ) rescue IOError => e raise unless e . message == 'not opened for writing' end end
Like #open, but reads zip archive contents from a String or open IO
stream, and outputs data to a buffer.
Like #open but reads zip archive contents from a String or open IO stream and outputs data to a buffer .
# https://github.com/rubyzip/rubyzip/issues/119
io
<not_specific>
options
<not_specific>