lib/slim_lint/utils.rb in slim_lint-0.6.1 vs lib/slim_lint/utils.rb in slim_lint-0.7.0
- old
+ new
@@ -55,12 +55,12 @@
# @yield [item] Passes item to the provided block.
# @yieldparam item [Object] Item to evaluate as matching criteria for
# inclusion
# @yieldreturn [Boolean] whether to include the item
# @return [Integer]
- def count_consecutive(items, offset = 0, &block)
+ def count_consecutive(items, offset = 0)
count = 1
- count += 1 while (offset + count < items.count) && block.call(items[offset + count])
+ count += 1 while (offset + count < items.count) && yield(items[offset + count])
count
end
# Calls a block of code with a modified set of environment variables,
# restoring them once the code has executed.