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

[POC] Replace erubis with erubi #300

Merged
merged 1 commit into from
Jul 3, 2019
Merged

[POC] Replace erubis with erubi #300

merged 1 commit into from
Jul 3, 2019

Conversation

jrafanie
Copy link
Contributor

@jrafanie jrafanie commented Apr 5, 2019

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.

@jrafanie jrafanie changed the title [POC] Replace erubi with erubis [POC] Replace erubis with erubi Apr 5, 2019
when NilClass
b = binding
else
raise ArgumentError
Copy link
Contributor Author

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

@jrafanie jrafanie mentioned this pull request Apr 5, 2019
9 tasks
@jrafanie
Copy link
Contributor Author

@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

@djberg96
Copy link

👍

@mwrock mwrock merged commit 68f1492 into WinRb:master Jul 3, 2019
@jrafanie jrafanie deleted the use_erubi branch July 8, 2019 15:45
donoghuc added a commit to donoghuc/winrm-fs that referenced this pull request Nov 4, 2019
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
donoghuc added a commit to donoghuc/winrm-fs that referenced this pull request Nov 4, 2019
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
jrafanie added a commit to jrafanie/winrm-elevated that referenced this pull request Nov 5, 2019
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
@jrafanie
Copy link
Contributor Author

jrafanie commented Nov 5, 2019

See also WinRb/winrm-elevated#29 .... are there any other gems that use erubis?

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