diff options
Diffstat (limited to 'lib/yahns/config.rb')
-rw-r--r-- | lib/yahns/config.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/yahns/config.rb b/lib/yahns/config.rb index a46868b..29f5746 100644 --- a/lib/yahns/config.rb +++ b/lib/yahns/config.rb @@ -22,9 +22,10 @@ class Yahns::Config # :nodoc: return var if @block == nil msg = "#{var} must be called outside of #{@block.type}" else - return var if @block && ctx == @block.type + ctx = Array(ctx) + return var if @block && ctx.include?(@block.type) msg = @block ? "may not be used inside a #{@block.type} block" : - "must be used with a #{ctx} block" + "must be used with a #{ctx.join(' or ')} block" end raise ArgumentError, msg end @@ -91,7 +92,7 @@ class Yahns::Config # :nodoc: %w(atfork_prepare atfork_parent atfork_child).each do |fn| eval( %Q(def #{fn}(*args, &blk);) << - %Q( _check_in_block(:worker_processes, :#{fn});) << + %Q( _check_in_block([:worker_processes,:app], :#{fn});) << %Q( _add_hook(:#{fn}, block_given? ? blk : args[0]);) << %Q(end) ) |