lib/progress/enumerable.rb in progress-0.0.7.1 vs lib/progress/enumerable.rb in progress-0.0.8

- old
+ new

@@ -2,12 +2,12 @@ # note that Progress.step is called automatically # ==== Example # [1, 2, 3].each_with_progress('Numbers') do |number| # sleep(number) # end - def each_with_progress(name) - Progress.start(name, length) do + def each_with_progress(name, options = {}) + Progress.start(name, length, options) do each do |item| yield item Progress.step end end @@ -16,11 +16,11 @@ # note that Progress.step is called automatically # ==== Example # [1, 2, 3].each_with_index_and_progress('Numbers') do |number, index| # sleep(number) # end - def each_with_index_and_progress(name) - Progress.start(name, length) do + def each_with_index_and_progress(name, options = {}) + Progress.start(name, length, options) do each_with_index do |item, index| yield item, index Progress.step end end