Module: Romglog
- Defined in:
- lib/romglog.rb
Defined Under Namespace
Classes: Base
Constant Summary collapse
- VERSION =
'0.0.8'
Class Method Summary collapse
Class Method Details
.on_terminal_resize(&block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/romglog.rb', line 13 def on_terminal_resize &block rendering = true trap("WINCH") { # A dragging resize fires lots of WINCH events; this throttles the redraw # and should cause it to (usually) line up with the final dimensions. if rendering rendering = false sleep 0.5 rendering = true yield end } end |
.run_on(system) ⇒ Object
6 7 8 9 10 |
# File 'lib/romglog.rb', line 6 def run_on system Romglog::Base.run on_terminal_resize { Romglog::Base.run } system.on_change { Romglog::Base.run } end |