Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split namespace of env-dependent I/O classes
- Loading branch information
Showing
5 changed files
with
125 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
require 'timeout' | ||
|
||
class Reline::GeneralIO | ||
@@buf = [] | ||
|
||
def self.input=(val) | ||
@@input = val | ||
end | ||
|
||
def self.getc | ||
c = nil | ||
loop do | ||
result = select([@@input], [], [], 0.1) | ||
next if result.nil? | ||
c = @@input.read(1) | ||
break | ||
end | ||
c&.ord | ||
end | ||
|
||
def self.get_screen_size | ||
[1, 1] | ||
end | ||
|
||
def self.cursor_pos | ||
Reline::CursorPos.new(1, 1) | ||
end | ||
|
||
def self.move_cursor_column(val) | ||
end | ||
|
||
def self.move_cursor_up(val) | ||
end | ||
|
||
def self.move_cursor_down(val) | ||
end | ||
|
||
def self.erase_after_cursor | ||
end | ||
|
||
def self.scroll_down(val) | ||
end | ||
|
||
def self.clear_screen | ||
end | ||
|
||
def self.set_screen_size(rows, columns) | ||
end | ||
|
||
def self.prep | ||
end | ||
|
||
def self.deprep(otio) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.