Class: Reline::GeneralIO
- Inherits:
-
Object
- Object
- Reline::GeneralIO
- Defined in:
- lib/reline/general_io.rb
Constant Summary collapse
- RAW_KEYSTROKE_CONFIG =
{}
- @@buf =
[]
- @@pasting =
false
Class Method Summary collapse
- .clear_screen ⇒ Object
- .cursor_pos ⇒ Object
- .deprep(otio) ⇒ Object
- .encoding ⇒ Object
- .erase_after_cursor ⇒ Object
- .finish_pasting ⇒ Object
- .get_screen_size ⇒ Object
- .getc ⇒ Object
- .in_pasting? ⇒ Boolean
- .input=(val) ⇒ Object
- .move_cursor_column(val) ⇒ Object
- .move_cursor_down(val) ⇒ Object
- .move_cursor_up(val) ⇒ Object
- .prep ⇒ Object
- .reset ⇒ Object
- .scroll_down(val) ⇒ Object
- .set_screen_size(rows, columns) ⇒ Object
- .set_winch_handler(&handler) ⇒ Object
- .start_pasting ⇒ Object
- .ungetc(c) ⇒ Object
- .win? ⇒ Boolean
Class Method Details
.clear_screen ⇒ Object
65 66 |
# File 'lib/reline/general_io.rb', line 65 def self.clear_screen end |
.cursor_pos ⇒ Object
46 47 48 |
# File 'lib/reline/general_io.rb', line 46 def self.cursor_pos Reline::CursorPos.new(1, 1) end |
.deprep(otio) ⇒ Object
91 92 |
# File 'lib/reline/general_io.rb', line 91 def self.deprep(otio) end |
.encoding ⇒ Object
8 9 10 |
# File 'lib/reline/general_io.rb', line 8 def self.encoding RUBY_PLATFORM =~ /mswin|mingw/ ? Encoding::UTF_8 : Encoding::default_external end |
.erase_after_cursor ⇒ Object
59 60 |
# File 'lib/reline/general_io.rb', line 59 def self.erase_after_cursor end |
.finish_pasting ⇒ Object
84 85 86 |
# File 'lib/reline/general_io.rb', line 84 def self.finish_pasting @@pasting = false end |
.get_screen_size ⇒ Object
42 43 44 |
# File 'lib/reline/general_io.rb', line 42 def self.get_screen_size [1, 1] end |
.getc ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/reline/general_io.rb', line 24 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 |
.in_pasting? ⇒ Boolean
76 77 78 |
# File 'lib/reline/general_io.rb', line 76 def self.in_pasting? @@pasting end |
.input=(val) ⇒ Object
20 21 22 |
# File 'lib/reline/general_io.rb', line 20 def self.input=(val) @@input = val end |
.move_cursor_column(val) ⇒ Object
50 51 |
# File 'lib/reline/general_io.rb', line 50 def self.move_cursor_column(val) end |
.move_cursor_down(val) ⇒ Object
56 57 |
# File 'lib/reline/general_io.rb', line 56 def self.move_cursor_down(val) end |
.move_cursor_up(val) ⇒ Object
53 54 |
# File 'lib/reline/general_io.rb', line 53 def self.move_cursor_up(val) end |
.prep ⇒ Object
88 89 |
# File 'lib/reline/general_io.rb', line 88 def self.prep end |
.reset ⇒ Object
4 5 6 |
# File 'lib/reline/general_io.rb', line 4 def self.reset @@pasting = false end |
.scroll_down(val) ⇒ Object
62 63 |
# File 'lib/reline/general_io.rb', line 62 def self.scroll_down(val) end |
.set_screen_size(rows, columns) ⇒ Object
68 69 |
# File 'lib/reline/general_io.rb', line 68 def self.set_screen_size(rows, columns) end |
.set_winch_handler(&handler) ⇒ Object
71 72 |
# File 'lib/reline/general_io.rb', line 71 def self.set_winch_handler(&handler) end |
.start_pasting ⇒ Object
80 81 82 |
# File 'lib/reline/general_io.rb', line 80 def self.start_pasting @@pasting = true end |
.ungetc(c) ⇒ Object
38 39 40 |
# File 'lib/reline/general_io.rb', line 38 def self.ungetc(c) @@buf.unshift(c) end |
.win? ⇒ Boolean
12 13 14 |
# File 'lib/reline/general_io.rb', line 12 def self.win? false end |