thisismydesign / autowow

Set of commands to [auto]mate [w]ay [o]f [w]orking
MIT License
4 stars 0 forks source link

Broken compat with ruby 3.x & tty-commands #42

Open FabriceCastel opened 4 months ago

FabriceCastel commented 4 months ago

Autowow no longer seems to work. After installing it, if I run aw rpa I'm hit with:

...ruby/3.3.1/lib/ruby/gems/3.3.0/gems/tty-command-0.10.1/lib/tty/command.rb:54:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
    from ...ruby/3.3.1/lib/ruby/gems/3.3.0/gems/autowow-0.17.1/lib/autowow/executor.rb:87:in `new'
    from ...ruby/3.3.1/lib/ruby/gems/3.3.0/gems/autowow-0.17.1/lib/autowow/executor.rb:87:in `pretty_with_output'

From what digging I did, this seems to be happening because autowow attempts to pass a hash object with string keys into tty-command's initialize(**options), and in ruby 3.x the double splat param explicitly requires passing in keyword args, ie.

initialize({ "a" => 1 }) # broken
initialize(a: 1) # works
initialize({ "a" => 1 }.symbolize_keys) # works
thisismydesign commented 4 months ago

This is fixed on master but wasn't released. You can install the gem from the source for now.