seven_zip_ruby
seven_zip_ruby copied to clipboard
`SevenZipRuby::Reader` should return result from block instead of szr.close
Both
SevenZipRuby::Reader.open(not#open)SevenZipRuby::Reader.open_file(not#open_file) returnszr.closeinstead ofblock.call(szr)which is inconvenient.
The built-in File class does return block value when File.open is used with block:
With no associated block, File.open is a synonym for ::new.
If the optional code block is given, it will be passed the opened file as an argument and the File object will automatically be closed when the block terminates.
The value of the block will be returned from File.open.
Would you consider changing this behaviour in next major release?
Edit 1:
Looking at #close, which calls #close_file
It seems the returned result is always nil
So I think the behaviour can even be changed without breaking stuff