Skip to content

Commit

Permalink
ProgressBar::WithProgress use #size when available
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Dec 11, 2024
1 parent 70eb837 commit 63ed8d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/progress_bar/with_progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class ProgressBar
module WithProgress
def each_with_progress(*args, &block)
bar = ProgressBar.new(count, *args)
bar = ProgressBar.new(respond_to?(:size) && size || count, *args)
if block
each{ |obj| yield(obj).tap{ bar.increment! } }
else
Expand Down

0 comments on commit 63ed8d7

Please sign in to comment.