Browse files

Handle a nil argument to Einhorn::Worker.socket

  • Loading branch information...
1 parent d83384c commit 8beadcf4743cde1ff1a0067cd3a7cc21a6115453 @gdb gdb committed Sep 27, 2012
Showing with 9 additions and 2 deletions.
  1. +4 −0 History.txt
  2. +5 −2 lib/einhorn/worker.rb
View
4 History.txt
@@ -1,3 +1,7 @@
+=== 0.4.1 2012-09-27
+
+* Handle a nil argument to Einhorn::Worker.socket
+
=== 0.4.0 2012-09-26
* Switch the command-socket protocol from line-oriented JSON to
View
7 lib/einhorn/worker.rb
@@ -78,12 +78,15 @@ def self.ack!(discovery=:env, arg=nil)
true
end
- def self.socket(number=0)
+ def self.socket(number=nil)
+ number ||= 0
fds = einhorn_fds
fds ? fds[number] : nil
end
- def self.socket!(number=0)
+ def self.socket!(number=nil)
+ number ||= 0
+
unless fds = einhorn_fds
raise "No EINHORN_FDS provided in environment. Are you running under Einhorn?"
end

0 comments on commit 8beadcf

Please sign in to comment.