Closed abhinavs closed 3 years ago
I believe the **@cmd_options
version will work on rubies earlier than 2.7. I think it actually may work since ruby 2.0? Travis does test all the way back to 2.0 (which is further back than I expected!).
But it might be worth a try doing just the double splat version, and seeing if it passes CI? I think it may. So you may not need the ugly conditional, double splat can, I suspect, work in all supported versions. Alternately, if it does need a conditional, I think double-splat will work further back than 2.7.
Thanks, trying that.
@jrochkind Thanks for the review and helping out! ❤️
@abhinavs Thanks for fixing the warnings. ❤️
I'm currently going through tty
gems and updating them one by one. One thing I'm changing is swapping hash options to named keyword arguments. I plan to do the same here.
no problem, in fact, thanks a lot for creating tty and tty plugins - design is very clean. Just created blockr - used tty, tty-file and tty-command to create it. I am still exploring, will be building a few more command line apps.
@abhinavs blockr
sounds great! I enjoy hearing about new command-line tools built with tty components. Looking forward to more projects. A small heads-up, there is a road map for the tty
project in which I plan to drop thor
and replace it with a more powerful command-line parsing gem tty-option. You could explore it in your future projects as well and see how you like it.
looks very intuitive and very readable - will definitely try it out. Thanks @piotrmurach
Describe the change
Ruby 2.7 warning: "Using the last argument as keyword parameters is deprecated"
Why are we doing this?
In Ruby 2.7, the way ruby handles the positional arguments and keyword arguments is changed, aiming to provide a smooth transition to Ruby 3. This has resulted in warnings on the command line when one uses cmd.run.
Benefits
This will remove the warning message which is thrown
Drawbacks
Requirements
Put an X between brackets on each line if you have done the item: [] Tests written & passing locally? [] Code style checked? [] Rebased with
master
branch? [] Documentation updated?