From 602432714cd436b6f255e6ba6bc6fffbf5eca051 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Oct 2013 21:59:37 +0000 Subject: remove arity enforcement for atfork_* hooks It's usually given as a block, so Ruby won't care about arity there. Users will get the worker ID number as the first arg, making it possible to isolate some things to certain processes (e.g. for A/B testing). --- lib/yahns/config.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/yahns/config.rb') diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb index 873722d..a46868b 100644 --- a/lib/yahns/config.rb +++ b/lib/yahns/config.rb @@ -103,13 +103,8 @@ class Yahns::Config # :nodoc: end def _add_hook(var, my_proc) - case my_proc - when Proc - my_proc.arity == 0 or raise ArgumentError, - "#{var}=#{my_proc.inspect} should not take arguments" - else + Proc === my_proc or raise ArgumentError, "invalid type: #{var}=#{my_proc.inspect}" - end # this sets: # :atfork_prepare, :atfork_parent, :atfork_child -- cgit v1.2.3-24-ge0c7