Class: Main
- Inherits:
-
Object
- Object
- Main
- Defined in:
- app/main.rb
Instance Attribute Summary collapse
-
#arg ⇒ Object
Returns the value of attribute arg.
Instance Method Summary collapse
-
#initialize(arg) ⇒ Main
constructor
A new instance of Main.
- #run ⇒ Object
Constructor Details
#initialize(arg) ⇒ Main
Returns a new instance of Main.
6 7 8 9 10 |
# File 'app/main.rb', line 6 def initialize(arg) self.arg = arg raise 'Cannot run nested Tmux session' if commander.in_tmux? end |
Instance Attribute Details
#arg ⇒ Object
Returns the value of attribute arg.
4 5 6 |
# File 'app/main.rb', line 4 def arg @arg end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/main.rb', line 12 def run Curses.crmode state = initial_state window = display(state) begin loop do state = set_next_screen(window, state) window = display(state) end rescue ExitAction logger.info("Exiting") rescue Interrupt => exception logger.info("Interrupted: exiting application") rescue => exception logger.error(exception) logger.error(exception.backtrace) ensure Curses.close_screen end end |