-
Notifications
You must be signed in to change notification settings - Fork 27
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
Conversation
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.
f98f06b
to
a4bfba7
Compare
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 = '' |
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.
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.
thanks so much for taking care of this! |
See also WinRb/winrm-elevated#29 .... are there any other gems that use erubis? |
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