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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/spring/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

[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)


preload unless preloaded?
Expand Down
1 change: 1 addition & 0 deletions lib/spring/application_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def initialize(app_env, spring_env)
@spring_env = spring_env
@mutex = Mutex.new
@state = :running
@pid = nil
end

def log(message)
Expand Down