This commit is contained in:
Denis Knauf 2010-03-02 14:12:01 +01:00
parent c41586242a
commit 8877341fde

View file

@ -1,6 +1,5 @@
module Signal
def signame s
def Signal.signame s
case s
when String then s
when Symbol then s.to_s
@ -8,7 +7,7 @@ module Signal
end
end
def sig s
def Signal.sig s
case s
when Fixnum then s
when String then list[s]
@ -16,12 +15,12 @@ module Signal
end
end
list do |n, s|
Signal.list do |n, s|
Signal.const_set n, s
Signal.const_set "SIG#{n}", s
end
def [] s
def Signal.[] s
case s
when String then list[s]
when Symbol then list[s.to_s]
@ -29,7 +28,6 @@ module Signal
else raise ArgumentError
end
end
end
class Retries
attr_accessor :max, :range
@ -59,7 +57,6 @@ class RobustServer
end
def initialize *p
super *p
sh = method :signal_handler
@sigs = {
Signal[:INT] => sh, Signal[:HUP] => nil, Signal[:TERM] => sh,