In previous versions of Ruby, calling shell_out("cmd", { blah : "blah" }) would be interpreted correctly here as args = "cmd" and options = { blah : "blah" }.
However because this can be ambiguous to interpret, Ruby would give the warning:
warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
As of Ruby 3, shell_out("cmd", { blah : "blah" }) will be interpreted as args = ["cmd", { blah : "blah" }] and options = {}.
This can be fixed by passing in the options parameter with a double splat (**) in front of it to explicitly convert the hash into a keyword argument.
Description
In previous versions of Ruby, calling
shell_out("cmd", { blah : "blah" })
would be interpreted correctly here asargs = "cmd"
andoptions = { blah : "blah" }
.However because this can be ambiguous to interpret, Ruby would give the warning:
As of Ruby 3,
shell_out("cmd", { blah : "blah" })
will be interpreted asargs = ["cmd", { blah : "blah" }]
andoptions = {}
.This can be fixed by passing in the
options
parameter with a double splat (**) in front of it to explicitly convert the hash into a keyword argument.Issues Resolved
No open issues.
Check List