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

(maint) Replace erubis with erubi #79

Merged
merged 3 commits into from
Nov 5, 2019
Merged

Conversation

donoghuc
Copy link
Contributor

@donoghuc donoghuc commented 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 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
Pin rubocop < 0.69.0 (where they dropped support for ruby 2.2) and make suggested changes to maintain style compliance.
@donoghuc
Copy link
Contributor Author

donoghuc commented Nov 4, 2019

Hmm, Still working through the rubocop frozen sting change.... DO NOT MERGE for now.

When Rubocop added the frozen string literal optimization, assuming the buffer for the stream upload was a frozen string caused an exception. This commit removes the frozen string assumption from the file_transporter file.
@@ -451,6 +451,7 @@ def stream_upload(input_io, dest)
read_size = ((max_encoded_write - dest.length) / 4) * 3
chunk = 1
bytes = 0
# Do not freeze this string
buffer = ''
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a different buffer we could use here? It appears the input_io.read method will not accept a stringio there. But I did not spend much time on it.

@mwrock mwrock merged commit 035ad88 into WinRb:master Nov 5, 2019
@mwrock
Copy link
Member

mwrock commented Nov 5, 2019

thanks so much for taking care of this!

@jrafanie
Copy link

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