Skip to content
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

Merged
merged 3 commits into from
Jun 12, 2023
Merged

Support ERB syntax in old Ruby versions #100

merged 3 commits into from
Jun 12, 2023

Conversation

arielj
Copy link

@arielj arielj commented Jun 7, 2023

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

@arielj arielj requested a review from a team as a code owner June 7, 2023 14:22
@arielj arielj requested review from mateusdeap and removed request for a team June 7, 2023 14:22
@JuanVqz
Copy link
Member

JuanVqz commented Jun 9, 2023

Could you please add this change to the changelog? Looking good 👍

@arielj
Copy link
Author

arielj commented Jun 9, 2023

Could you please add this change to the changelog? Looking good +1

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\.]+) .*\]/
Copy link
Author

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

Copy link
Member

@JuanVqz JuanVqz left a 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 🎖️

@JuanVqz
Copy link
Member

JuanVqz commented Jun 9, 2023

@arielj could you please rebase the main branch? now the CI should work as expected 👍

@JuanVqz JuanVqz self-requested a review June 9, 2023 14:14
@mateusdeap
Copy link
Member

Looks good to me, but some of the runs were cancelled, is that expected? @arielj @JuanVqz

@arielj
Copy link
Author

arielj commented Jun 12, 2023

Looks good to me, but some of the runs were cancelled, is that expected? @arielj @JuanVqz

CI was broken (cancelling jobs) and it's fixed in the main branch, I have to merge main here and that will fix the tests

@JuanVqz JuanVqz merged commit 371ca16 into main Jun 12, 2023
@JuanVqz JuanVqz deleted the support-old-erb branch June 12, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants