-
Notifications
You must be signed in to change notification settings - Fork 346
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
Ruby Warnings #593
Conversation
@@ -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 } |
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.
Seems we aren't using these local variables at all. Can we just remove them?
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 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) } |
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.
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 } |
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 are using the stderr
in the rescue
block
This PR fixes some Ruby warnings.