lib/tresse.rb in tresse-1.1.0 vs lib/tresse.rb in tresse-1.1.1

- old
+ new

@@ -2,11 +2,11 @@ require 'thread' module Tresse - VERSION = '1.1.0' + VERSION = '1.1.1' class << self def init @@ -83,11 +83,11 @@ self.init def self.call_block(block, args) - block.call(*args[0, block.method(:call).arity.abs]) + block.call(*args[0, block.arity.abs]) end class Batch @@ -153,15 +153,15 @@ self end def source_each(collection, &block) - if collection.is_a?(Array) - collection.each_with_index { |e, i| - source { Tresse.call_block(block, [ e, i ]) } } - else + if collection.is_a?(Hash) collection.each { |k, v| source { Tresse.call_block(block, [ k, v ]) } } + else + collection.each_with_index { |e, i| + source { Tresse.call_block(block, [ e, i ]) } } end self end