Project

General

Profile

« Previous | Next » 

Revision f451bb54

Added by larskanis (Lars Kanis) over 5 years ago

[ruby/irb] Fix compatibility with rails before 5.2

Rails before 5.2 added Array#append as an alias to Array#<< ,
so that it expects only one argument.
However ruby-2.5 added Array#append as an alias to Array#push
which takes any number of arguments.

If irb completion is used in rails c (for example "IO.")
it fails with:
irb/completion.rb:206:in `<<': wrong number of arguments (given 3, expected 1) (ArgumentError)

Using Array#push instead of Array#append fixes compatibility.

https://github.com/ruby/irb/commit/5b7bbf9c34