Class: Reline::GeneralIO

Inherits:
Object
  • Object
show all
Defined in:
lib/reline/general_io.rb

Constant Summary collapse

RAW_KEYSTROKE_CONFIG =
{}
@@buf =
[]

Class Method Summary collapse

Class Method Details

.clear_screenObject



61
62
# File 'lib/reline/general_io.rb', line 61

def self.clear_screen
end

.cursor_posObject



42
43
44
# File 'lib/reline/general_io.rb', line 42

def self.cursor_pos
  Reline::CursorPos.new(1, 1)
end

.deprep(otio) ⇒ Object



73
74
# File 'lib/reline/general_io.rb', line 73

def self.deprep(otio)
end

.encodingObject



4
5
6
# File 'lib/reline/general_io.rb', line 4

def self.encoding
  RUBY_PLATFORM =~ /mswin|mingw/ ? Encoding::UTF_8 : Encoding::default_external
end

.erase_after_cursorObject



55
56
# File 'lib/reline/general_io.rb', line 55

def self.erase_after_cursor
end

.get_screen_sizeObject



38
39
40
# File 'lib/reline/general_io.rb', line 38

def self.get_screen_size
  [1, 1]
end

.getcObject



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/reline/general_io.rb', line 20

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



16
17
18
# File 'lib/reline/general_io.rb', line 16

def self.input=(val)
  @@input = val
end

.move_cursor_column(val) ⇒ Object



46
47
# File 'lib/reline/general_io.rb', line 46

def self.move_cursor_column(val)
end

.move_cursor_down(val) ⇒ Object



52
53
# File 'lib/reline/general_io.rb', line 52

def self.move_cursor_down(val)
end

.move_cursor_up(val) ⇒ Object



49
50
# File 'lib/reline/general_io.rb', line 49

def self.move_cursor_up(val)
end

.prepObject



70
71
# File 'lib/reline/general_io.rb', line 70

def self.prep
end

.scroll_down(val) ⇒ Object



58
59
# File 'lib/reline/general_io.rb', line 58

def self.scroll_down(val)
end

.set_screen_size(rows, columns) ⇒ Object



64
65
# File 'lib/reline/general_io.rb', line 64

def self.set_screen_size(rows, columns)
end

.set_winch_handler(&handler) ⇒ Object



67
68
# File 'lib/reline/general_io.rb', line 67

def self.set_winch_handler(&handler)
end

.ungetc(c) ⇒ Object



34
35
36
# File 'lib/reline/general_io.rb', line 34

def self.ungetc(c)
  @@buf.unshift(c)
end

.win?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/reline/general_io.rb', line 8

def self.win?
  false
end