Skip to content

Ruby Warnings #593

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

Merged
merged 2 commits into from
Jun 12, 2019
Merged

Ruby Warnings #593

merged 2 commits into from
Jun 12, 2019

Conversation

amatsuda
Copy link
Member

This PR fixes some Ruby warnings.

@@ -147,7 +147,7 @@ def serve(client)
log "got client"
manager.puts

stdout, stderr, stdin = streams = 3.times.map { client.recv_io }
_stdout, stderr, _stdin = streams = 3.times.map { client.recv_io }
Copy link
Member

Choose a reason for hiding this comment

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

Seems we aren't using these local variables at all. Can we just remove them?

Copy link
Member

Choose a reason for hiding this comment

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

We are using the stderr in the rescue block

@@ -147,7 +147,7 @@ def serve(client)
log "got client"
manager.puts

stdout, stderr, stdin = streams = 3.times.map { client.recv_io }
_stdout, stderr, _stdin = streams = 3.times.map { client.recv_io }
[STDOUT, STDERR, STDIN].zip(streams).each { |a, b| a.reopen(b) }
Copy link
Member

Choose a reason for hiding this comment

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

Might be clearer to do this explicitly, even 😅

-stdout, stderr, stdin = streams = 3.times.map { client.recv_io }
-[STDOUT, STDERR, STDIN].zip(streams).each { |a, b| a.reopen(b) }
+STDOUT.reopen(client.recv_io)
+STDERR.reopen(client.recv_io)
+STDIN.reopen(client.recv_io)

@@ -147,7 +147,7 @@ def serve(client)
log "got client"
manager.puts

stdout, stderr, stdin = streams = 3.times.map { client.recv_io }
_stdout, stderr, _stdin = streams = 3.times.map { client.recv_io }
Copy link
Member

Choose a reason for hiding this comment

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

We are using the stderr in the rescue block

@rafaelfranca rafaelfranca merged commit 8329dd9 into rails:master Jun 12, 2019
rafaelfranca added a commit that referenced this pull request Jun 13, 2019
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