seven_zip_ruby icon indicating copy to clipboard operation
seven_zip_ruby copied to clipboard

`SevenZipRuby::Reader` should return result from block instead of szr.close

Open PikachuEXE opened this issue 8 years ago • 0 comments

Both

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

PikachuEXE avatar Mar 10 '17 05:03 PikachuEXE