Closed benkoshy closed 2 years ago
Hey @benkoshy, since you are working on the options and using **
to pass them along. Did you by any chance also get deprecation warnings with Ruby 2.7 regarding this call?
.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/zipline-1.3.0/lib/zipline/zip_generator.rb:83: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/zip_tricks-5.5.0/lib/zip_tricks/streamer.rb:339: warning: The called method `write_deflated_file' is defined here
PS: Oh, I didn't know about deduplication in zip_tricks, we've implemented our own deduplication code in the meantime, but this PR would be a great way to remove our own code.
@aried3r
Hey @benkoshy, since you are working on the options and using ** to pass them along. Did you by any chance also get deprecation warnings with Ruby 2.7 regarding this call?
streamer.write_deflated_file(name, options)
are different to the Streamer initialization options (see here: https://github.com/fringd/zipline/blob/ac1977eec593aa59e3cafbd05fae29f20f17b14f/lib/zipline/zip_generator.rb#L33), so no deprecation warnings would be triggered.Having said that, it looks like there are no tests associated with the helper method. I might add one to ensure that the options are in fact passed, and initialized correct.
👀
@fringd Hey Ram, is there anything you need me to do, in order to merge this? I had actually forgotten about it, but will be revisiting this issue in a few weeks. Pls LMK.
Would be nice to get this merged sometime soon! @fringd anything we can do to speed up the process? Thanks!
hey sorry for the slow response. I've resolved the conflicts but see some failing tests. Could someone take a look and resolve those?
one more request. could you include a test that exercises this functionality? just verify that argments are passed along to zip tricks?
sorry i got the tests more or less good for you. they were bad on master for some reason. i think something's wrong with ruby head, disabled it for now
What is this commit?
Allows for options to be passed in (if required).
Why do we all need it?
Sometimes we may need to pass in options in order to access specific functionality.
In my particular case, I want to pass in the options to allow for duplicate file names to be renamed. The default is
false
but I would like it to be true. Things will still work with the default, as it was before.Those options are then passed on to the delegated Ziptricks streamer and everyone's happy!
Tests
I did not find a test for the zipline helper, so I have simply passed in the parameter and tested it manually on my end. I'm not sure how we would test the
Zipline::zipline
helper method.Please let me know if there are any issues and I hope to be able to work towards clearing them up.
Ben