TypeError: no implicit conversion of Hash into Integer
ERB 2.1.0 does NOT support the trim_mode: keyword argument, it has a positional argument.
Possible Fix
Check which version of ERB is the project running (with ERB.version) and use different parameters.
To Reproduce
Use an old ERB version (has to be older than 2.2)
Call ERB.new("some string", trim_mode: "-").result(binding) and it should fail with the error.
Call ERB.new("some_string", nil, "-").result(binding) and it should work
Expected Behavior
Generating the report should succeed with no error.
Actual Behavior
In some cases (maybe specific ERB versions and Ruby versions combination?), there's an error in this line:
https://github.com/fastruby/next_rails/blob/main/lib/next_rails/bundle_report.rb#L52
ERB 2.1.0 does NOT support the
trim_mode:
keyword argument, it has a positional argument.Possible Fix
Check which version of ERB is the project running (with ERB.version) and use different parameters.
To Reproduce
Use an old ERB version (has to be older than 2.2) Call
ERB.new("some string", trim_mode: "-").result(binding)
and it should fail with the error. CallERB.new("some_string", nil, "-").result(binding)
and it should workAdditional Information
Found this with ERB 2.1.0 and Ruby 2.3.8.
I will abide by the code of conduct