-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ERB syntax in old Ruby versions #100
Conversation
Could you please add this change to the changelog? Looking good 👍 |
done! |
@@ -49,7 +53,16 @@ def compatibility(rails_version: nil, include_rails_gems: nil) | |||
<%= incompatible_gems.length.to_s.red %> gems incompatible with Rails <%= rails_version %> | |||
ERB | |||
|
|||
puts ERB.new(template, trim_mode: "-").result(binding) | |||
erb_version = ERB.version | |||
if erb_version =~ /erb.rb \[([\d\.]+) .*\]/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in older erb versions, the version
string was something like erb [2.2.0 2019-10-04]
instead of just the version, but it changed in newer versions to just 4.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing 🎖️
@arielj could you please rebase the main branch? now the CI should work as expected 👍 |
Description
The bundler report compatibility command didn't work in old ERB version. This PR adds a test that exercises that line and also the fix calling
ERB.new
with different arguments depending on the ERB version.Motivation and Context
This issue #99
I think this is the same issue #96
How Has This Been Tested?
Added automated tests, without this change it fails in Ruby 2.3
I will abide by the code of conduct