From 26a1ab2e142d47b51da27650a5ba3f88964d82bf Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Wed, 3 Jul 2013 09:25:48 -0500 Subject: [PATCH] Standardize "block" usage This commit standardizes on the use of `block` over `blk`. I found the usage of both in the code. --- lib/puma/cli.rb | 4 ++-- lib/puma/configuration.rb | 4 ++-- lib/puma/delegation.rb | 4 ++-- lib/puma/thread_pool.rb | 4 ++-- test/test_thread_pool.rb | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/puma/cli.rb b/lib/puma/cli.rb index b58fa728..6c7dd3a4 100644 --- a/lib/puma/cli.rb +++ b/lib/puma/cli.rb @@ -105,8 +105,8 @@ module Puma end def restart! - @options[:on_restart].each do |blk| - blk.call self + @options[:on_restart].each do |block| + block.call self end if jruby? diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index be4f2321..2d06cd0a 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -203,8 +203,8 @@ module Puma # # This can be called multiple times to add code each time. # - def on_restart(&blk) - @options[:on_restart] << blk + def on_restart(&block) + @options[:on_restart] << block end # Command to use to restart puma. This should be just how to diff --git a/lib/puma/delegation.rb b/lib/puma/delegation.rb index fd0c5f8d..e11df31a 100644 --- a/lib/puma/delegation.rb +++ b/lib/puma/delegation.rb @@ -2,8 +2,8 @@ module Puma module Delegation def forward(what, who) module_eval <<-CODE - def #{what}(*args, &blk) - #{who}.#{what}(*args, &blk) + def #{what}(*args, &block) + #{who}.#{what}(*args, &block) end CODE end diff --git a/lib/puma/thread_pool.rb b/lib/puma/thread_pool.rb index 5d61dbd7..3b686c32 100644 --- a/lib/puma/thread_pool.rb +++ b/lib/puma/thread_pool.rb @@ -11,7 +11,7 @@ module Puma # The block passed is the work that will be performed in each # thread. # - def initialize(min, max, *extra, &blk) + def initialize(min, max, *extra, &block) @cond = ConditionVariable.new @mutex = Mutex.new @@ -22,7 +22,7 @@ module Puma @min = min @max = max - @block = blk + @block = block @extra = extra @shutdown = false diff --git a/test/test_thread_pool.rb b/test/test_thread_pool.rb index 0b5b0349..7e6d0cc9 100644 --- a/test/test_thread_pool.rb +++ b/test/test_thread_pool.rb @@ -8,9 +8,9 @@ class TestThreadPool < Test::Unit::TestCase @pool.shutdown if @pool end - def new_pool(min, max, &blk) - blk = proc { } unless blk - @pool = Puma::ThreadPool.new(min, max, &blk) + def new_pool(min, max, &block) + block = proc { } unless block + @pool = Puma::ThreadPool.new(min, max, &block) end def pause