Skip to content

Commit 611b997

Browse files
committed
Refactor: Send All Progress Events To The Projector
Why This Change Is Necessary ======================================================================== The projectors need to know when progress changes so that eventually it will be able to update the projection each time it does. What These Changes Do To Address the Issue ======================================================================== Start calling the methods on the projector but stub out the various progress methods as noops. Side Effects Caused By This Change ======================================================================== None expected.
1 parent a568206 commit 611b997

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/ruby-progressbar/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def reset
111111
output.with_refresh do
112112
self.finished = false
113113
progressable.reset
114+
projector.reset
114115
timer.reset
115116
end
116117
end
@@ -221,6 +222,7 @@ def format=(other)
221222
def update_progress(*args)
222223
output.with_refresh do
223224
progressable.__send__(*args)
225+
projector.__send__(*args)
224226
timer.stop if finished?
225227
end
226228
end

lib/ruby-progressbar/calculators/smoothed_average.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def start(_options = {})
1515
self.projection = 0.0
1616
end
1717

18+
def decrement; end
19+
def increment; end
20+
def progress=(_new_progress); end
21+
def total=(_new_total); end
22+
def reset; end
23+
1824
def calculate(new_value)
1925
self.projection = \
2026
self.class.calculate(

0 commit comments

Comments
 (0)