When using Ruby 3+ on tty, we'll encounter this error (in tty-command) trying to make a new app:
$ teletype new my_app
/Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-command-0.9.0/lib/tty/command.rb:54:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/lib/tty/cmd.rb:33:in `new'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/lib/tty/cmd.rb:33:in `command'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/lib/tty/commands/new.rb:46:in `initialize'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/lib/tty/cli.rb:128:in `new'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/lib/tty/cli.rb:128:in `new'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/lib/ruby/gems/3.0.0/gems/tty-0.10.0/exe/teletype:14:in `<top (required)>'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/bin/teletype:25:in `load'
from /Users/justin.gaylor/.asdf/installs/ruby/3.0.3/bin/teletype:25:in `<main>'
By fixing this issue in tty-command and bumping the version in tty, hopefully we'll be a step closer to being able to use tty with Ruby 3+. (There is a separate "*': negative argument (ArgumentError)"issue that happens intty` after this is fixed, so I will look into that after this gem gets fixed up.)
Also, unit tests also were updated for a separate issue. When there is a space in the path to the checked out repo base, specs fail due to TTY::Command invoking ruby scripts in numerous places without shell escaping. This is fixed so specs will run for everybody.
Why are we doing this?
tty-command doesn't work on Ruby 3.0 or higher.
Benefits
We can more easily move tty-command (and thus the greater tty toolkit) forward to Ruby 3! 🚀
Describe the change
This PR fixes a Ruby 3.0 failure (warning in Ruby 2.7) when using double splat operator/keyword params similar to this fix: https://github.com/piotrmurach/tty-command/commit/5f422f89dd4dbfa96ca849cf5f9dcc6cac8b19e8
When using Ruby 3+ on
tty
, we'll encounter this error (intty-command
) trying to make a new app:By fixing this issue in
tty-command
and bumping the version intty
, hopefully we'll be a step closer to being able to usetty
with Ruby 3+. (There is a separate"
*': negative argument (ArgumentError)"issue that happens in
tty` after this is fixed, so I will look into that after this gem gets fixed up.)For further on the exact issue, read here.
Also, unit tests also were updated for a separate issue. When there is a space in the path to the checked out repo base, specs fail due to
TTY::Command
invoking ruby scripts in numerous places without shell escaping. This is fixed so specs will run for everybody.Why are we doing this?
tty-command
doesn't work on Ruby 3.0 or higher.Benefits
We can more easily move
tty-command
(and thus the greatertty
toolkit) forward to Ruby 3! 🚀Drawbacks
None.
Requirements
master
branch?