Class: Reline::GeneralIO
- Inherits:
-
Object
- Object
- Reline::GeneralIO
- Defined in:
- lib/reline/general_io.rb
Constant Summary collapse
- RAW_KEYSTROKE_CONFIG =
{}
- @@buf =
[]
Class Method Summary collapse
- .clear_screen ⇒ Object
- .cursor_pos ⇒ Object
- .deprep(otio) ⇒ Object
- .erase_after_cursor ⇒ Object
- .get_screen_size ⇒ Object
- .getc ⇒ Object
- .input=(val) ⇒ Object
- .move_cursor_column(val) ⇒ Object
- .move_cursor_down(val) ⇒ Object
- .move_cursor_up(val) ⇒ Object
- .prep ⇒ Object
- .scroll_down(val) ⇒ Object
- .set_screen_size(rows, columns) ⇒ Object
- .set_winch_handler(&handler) ⇒ Object
- .ungetc(c) ⇒ Object
Class Method Details
.clear_screen ⇒ Object
53 54 |
# File 'lib/reline/general_io.rb', line 53 def self.clear_screen end |
.cursor_pos ⇒ Object
34 35 36 |
# File 'lib/reline/general_io.rb', line 34 def self.cursor_pos Reline::CursorPos.new(1, 1) end |
.deprep(otio) ⇒ Object
65 66 |
# File 'lib/reline/general_io.rb', line 65 def self.deprep(otio) end |
.erase_after_cursor ⇒ Object
47 48 |
# File 'lib/reline/general_io.rb', line 47 def self.erase_after_cursor end |
.get_screen_size ⇒ Object
30 31 32 |
# File 'lib/reline/general_io.rb', line 30 def self.get_screen_size [1, 1] end |
.getc ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/reline/general_io.rb', line 12 def self.getc unless @@buf.empty? return @@buf.shift end c = nil loop do result = select([@@input], [], [], 0.1) next if result.nil? c = @@input.read(1) break end c&.ord end |
.input=(val) ⇒ Object
8 9 10 |
# File 'lib/reline/general_io.rb', line 8 def self.input=(val) @@input = val end |
.move_cursor_column(val) ⇒ Object
38 39 |
# File 'lib/reline/general_io.rb', line 38 def self.move_cursor_column(val) end |
.move_cursor_down(val) ⇒ Object
44 45 |
# File 'lib/reline/general_io.rb', line 44 def self.move_cursor_down(val) end |
.move_cursor_up(val) ⇒ Object
41 42 |
# File 'lib/reline/general_io.rb', line 41 def self.move_cursor_up(val) end |
.prep ⇒ Object
62 63 |
# File 'lib/reline/general_io.rb', line 62 def self.prep end |
.scroll_down(val) ⇒ Object
50 51 |
# File 'lib/reline/general_io.rb', line 50 def self.scroll_down(val) end |
.set_screen_size(rows, columns) ⇒ Object
56 57 |
# File 'lib/reline/general_io.rb', line 56 def self.set_screen_size(rows, columns) end |
.set_winch_handler(&handler) ⇒ Object
59 60 |
# File 'lib/reline/general_io.rb', line 59 def self.set_winch_handler(&handler) end |
.ungetc(c) ⇒ Object
26 27 28 |
# File 'lib/reline/general_io.rb', line 26 def self.ungetc(c) @@buf.unshift(c) end |