Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options parameter to Zip::File.open. #418

Merged
merged 2 commits into from Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/zip/file.rb
Expand Up @@ -104,11 +104,11 @@ def initialize(path_or_io, create = false, buffer = false, options = {})
end

class << self
# Same as #new. If a block is passed the ZipFile object is passed
# to the block and is automatically closed afterwards just as with
# ruby's builtin File.open method.
def open(file_name, create = false)
zf = ::Zip::File.new(file_name, create)
# Similar to ::new. If a block is passed the Zip::File object is passed
# to the block and is automatically closed afterwards, just as with
# ruby's builtin File::open method.
def open(file_name, create = false, options = {})
zf = ::Zip::File.new(file_name, create, false, options)
return zf unless block_given?
begin
yield zf
Expand Down