8000 Merge pull request #418 from hainesr/open-options · rubyzip/rubyzip@056c00c · GitHub
[go: up one dir, main page]

Skip to content

Commit 056c00c

Browse files
authored
Merge pull request #418 from hainesr/open-options
Add `options` parameter to `Zip::File.open`.
2 parents 15a54b4 + 3fea995 commit 056c00c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/zip/file.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ def initialize(path_or_io, create = false, buffer = false, options = {})
104104
end
105105

106106
class << self
107-
# Same as #new. If a block is passed the ZipFile object is passed
108-
# to the block and is automatically closed afterwards just as with
109-
# ruby's builtin File.open method.
110-
def open(file_name, create = false)
111-
zf = ::Zip::File.new(file_name, create)
107+
# Similar to ::new. If a block is passed the Zip::File object is passed
108+
# to the block and is automatically closed afterwards, just as with
109+
# ruby's builtin File::open method.
110+
def open(file_name, create = false, options = {})
111+
zf = ::Zip::File.new(file_name, create, false, options)
112112
return zf unless block_given?
113113
begin
114114
yield zf

0 commit comments

Comments
 (0)
0