lib/space/screen/progress.rb in space-0.0.5 vs lib/space/screen/progress.rb in space-0.0.6
- old
+ new
@@ -1,15 +1,26 @@
module Space
class Screen
class Progress < View
- def render
- App.logger.debug('RENDER dashboard')
- clear
- render_header
+ def initialize(*)
+ super
+ Events.subscribe(self, :start, :update)
end
def notify(event)
- print '.'
+ case event
+ when :start
+ clear
+ when :update
+ print '.'
+ end
end
+
+ private
+
+ def clear
+ move 0, 5
+ print "\e[0J" # clear from cursor down
+ end
end
end
end