-
Notifications
You must be signed in to change notification settings - Fork 118
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
[POC] Replace erubis with erubi #300
Conversation
Reasons: rails/rails#27757 We needed to implement the result method from erubis: https://www.rubydoc.info/gems/erubis/2.7.0/Erubis/RubyEvaluator#result-instance_method
when NilClass | ||
b = binding | ||
else | ||
raise ArgumentError |
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.
We can raise a more relevant message if needed
@mwrock Sorry to ping you directly, but in case you just missed this PR, I'd like to hear your opinion on replacing erubis with erubi. It's a concern because even if we're not using erubis with rails, just having erubis loaded by another gem causes a rails deprecation when loading rails templating engines. It seems like a good idea to drop erubis for all the reasons mentioned in the rails PR listed above, copied here for convenience: rails/rails#27757 |
👍 |
Port over the changes included in winrm gem to replace the deprecated erubis gem with the more light weight erubi gem. This also avoids the [cwe](https://cwe.mitre.org/data/definitions/79.html) some static analysis tools will pick up for the erubis gem. Ported from WinRb/WinRM#300 author: @jrafanie
Port over the changes included in winrm gem to replace the deprecated erubis gem with the more light weight erubi gem. This also avoids the [cwe](https://cwe.mitre.org/data/definitions/79.html) some static analysis tools will pick up for the erubis gem. Ported from WinRb/WinRM#300 author: @jrafanie
Adapted the change from: WinRb/WinRM#300 This grabs prior context or local variables, builds a string which set these variables, and evalulates them in the context of the binding. Note, this repo wasn't explicitly depending on erubis before but was trying to require it. I've also added erubi as a dependency so this gem can run standalone. Fixes WinRb#28
See also WinRb/winrm-elevated#29 .... are there any other gems that use erubis? |
I'm opening this pull request to see if this is something that would be ultimately accepted. It looks like people have been moving off of erubis because it's mostly unmaintained and more complicated.
This seems to have been influenced greatly by rails:
rails/rails#27757
We needed to implement the result method from erubis:
https://www.rubydoc.info/gems/erubis/2.7.0/Erubis/RubyEvaluator#result-instance_method
I got the tests to pass but I have no idea if I covered everything.