Class: Reline::GeneralIO

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

Constant Summary collapse

RAW_KEYSTROKE_CONFIG =
{}
@@buf =
[]
@@pasting =
false

Class Method Summary collapse

Class Method Details

.clear_screenObject



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

def self.clear_screen
end

.cursor_posObject



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

.encodingObject



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_cursorObject



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

def self.erase_after_cursor
end

.finish_pastingObject



84
85
86
# File 'lib/reline/general_io.rb', line 84

def self.finish_pasting
  @@pasting = false
end

.get_screen_sizeObject



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

def self.get_screen_size
  [1, 1]
end

.getcObject



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

Returns:

  • (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

.prepObject



88
89
# File 'lib/reline/general_io.rb', line 88

def self.prep
end

.resetObject



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_pastingObject



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

Returns:

  • (Boolean)


12
13
14
# File 'lib/reline/general_io.rb', line 12

def self.win?
  false
end