Class: LogBench::App::Screen
- Inherits:
-
Object
- Object
- LogBench::App::Screen
- Includes:
- Curses
- Defined in:
- lib/log_bench/app/screen.rb
Constant Summary collapse
- HEADER_HEIGHT =
Layout constants
5- PANEL_BORDER_WIDTH =
3- INPUT_TIMEOUT_MS =
200- HEADER_CYAN =
Color pairs
1- DEFAULT_WHITE =
2- SUCCESS_GREEN =
GET requests, 200 status
3- WARNING_YELLOW =
POST requests, warnings
4- INFO_BLUE =
PUT requests
5- ERROR_RED =
DELETE requests, errors
6- BRIGHT_WHITE =
7- BLACK =
8- MAGENTA =
9- SELECTION_HIGHLIGHT =
10
Instance Attribute Summary collapse
-
#detail_win ⇒ Object
readonly
Returns the value of attribute detail_win.
-
#header_win ⇒ Object
readonly
Returns the value of attribute header_win.
-
#log_win ⇒ Object
readonly
Returns the value of attribute log_win.
-
#panel_width ⇒ Object
readonly
Returns the value of attribute panel_width.
Instance Method Summary collapse
- #cleanup ⇒ Object
- #color_pair(n) ⇒ Object
- #height ⇒ Object
- #refresh_all ⇒ Object
- #setup ⇒ Object
- #turn_text_selection_mode(enabled) ⇒ Object
- #width ⇒ Object
Instance Attribute Details
#detail_win ⇒ Object
Returns the value of attribute detail_win.
25 26 27 |
# File 'lib/log_bench/app/screen.rb', line 25 def detail_win @detail_win end |
#header_win ⇒ Object
Returns the value of attribute header_win.
25 26 27 |
# File 'lib/log_bench/app/screen.rb', line 25 def header_win @header_win end |
#log_win ⇒ Object
Returns the value of attribute log_win.
25 26 27 |
# File 'lib/log_bench/app/screen.rb', line 25 def log_win @log_win end |
#panel_width ⇒ Object
Returns the value of attribute panel_width.
25 26 27 |
# File 'lib/log_bench/app/screen.rb', line 25 def panel_width @panel_width end |
Instance Method Details
#cleanup ⇒ Object
35 36 37 |
# File 'lib/log_bench/app/screen.rb', line 35 def cleanup close_screen end |
#color_pair(n) ⇒ Object
54 55 56 |
# File 'lib/log_bench/app/screen.rb', line 54 def color_pair(n) Curses.color_pair(n) end |
#height ⇒ Object
46 47 48 |
# File 'lib/log_bench/app/screen.rb', line 46 def height lines end |
#refresh_all ⇒ Object
39 40 41 42 43 44 |
# File 'lib/log_bench/app/screen.rb', line 39 def refresh_all header_win.refresh log_win.refresh detail_win.refresh refresh end |
#setup ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/log_bench/app/screen.rb', line 27 def setup init_screen setup_colors clear_screen_immediately setup_windows turn_text_selection_mode(false) end |
#turn_text_selection_mode(enabled) ⇒ Object
58 59 60 |
# File 'lib/log_bench/app/screen.rb', line 58 def turn_text_selection_mode(enabled) enabled ? mousemask(0) : mousemask(BUTTON1_CLICKED) end |
#width ⇒ Object
50 51 52 |
# File 'lib/log_bench/app/screen.rb', line 50 def width cols end |