fastruby / next_rails

A toolkit to upgrade your next Rails application
https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html?utm_source=github&utm_medium=description&utm_campaign=github&utm_term=next-rails
MIT License
466 stars 28 forks source link

[BUG] Fix ERB deprecation warning in Ruby 3.1 #90

Closed toppa closed 1 year ago

toppa commented 1 year ago

Expected Behavior

When I run bundle_report compatibility in Ruby 3.1 I don't expect to see any deprecation warnings, but I do

Actual Behavior

bundle_report compatibility --rails-version=7.0
/usr/local/lib/ruby/3.1.0/erb.rb:814: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/usr/local/lib/ruby/3.1.0/erb.rb:817: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.

Possible Fix

I see a call to ERB.new here, so I think updating the argument list might take care of it: https://github.com/fastruby/next_rails/blob/76888184c173301e4c0976a234e9115780bff639/lib/next_rails/bundle_report.rb#L52

To Reproduce

See sample output above

Additional Information

I will abide by the code of conduct