Skip to content

Commit

Permalink
Standardize "block" usage
Browse files Browse the repository at this point in the history
This commit standardizes on the use of `block` over `blk`. I found the usage of
both in the code.
  • Loading branch information
catsby committed Jul 3, 2013
1 parent 7ef7267 commit 26a1ab2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/puma/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def restart_args
end

def restart!
@options[:on_restart].each do |blk|
blk.call self
@options[:on_restart].each do |block|
block.call self
end

if jruby?
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def environment(environment)
#
# 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
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/delegation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/puma/thread_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ThreadPool
# 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

Expand All @@ -22,7 +22,7 @@ def initialize(min, max, *extra, &blk)

@min = min
@max = max
@block = blk
@block = block
@extra = extra

@shutdown = false
Expand Down
6 changes: 3 additions & 3 deletions test/test_thread_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def teardown
@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
Expand Down

0 comments on commit 26a1ab2

Please sign in to comment.