123456789_123456789_123456789_123456789_123456789_

Class: Reline::Dumb

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, IO
Instance Chain:
self, IO
Inherits: Reline::IO
Defined in: lib/reline/io/dumb.rb

Constant Summary

IO - Inherited

RESET_COLOR

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(encoding: nil) ⇒ Dumb

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 6

def initialize(encoding: nil)
  @input = STDIN
  @buf = []
  @pasting = false
  @encoding = encoding
  @screen_size = [24, 80]
end

Instance Attribute Details

#dumb?Boolean (readonly)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 14

def dumb?
  true
end

#in_pasting?Boolean (readonly)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 97

def in_pasting?
  @pasting
end

#input=(val) (writeonly)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 31

def input=(val)
  @input = val
end

Instance Method Details

#clear_screen

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 87

def clear_screen
end

#cursor_pos

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 62

def cursor_pos
  Reline::CursorPos.new(0, 0)
end

#deprep(otio)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 104

def deprep(otio)
end

#encoding

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 18

def encoding
  if @encoding
    @encoding
  elsif RUBY_PLATFORM =~ /mswin|mingw/
    Encoding::UTF_8
  else
    @input.external_encoding || Encoding::default_external
  end
end

#erase_after_cursor

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 81

def erase_after_cursor
end

#get_screen_size

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 58

def get_screen_size
  @screen_size
end

#getc(_timeout_second)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 39

def getc(_timeout_second)
  unless @buf.empty?
    return @buf.shift
  end
  c = nil
  loop do
    Reline.core.line_editor.handle_signal
    result = @input.wait_readable(0.1)
    next if result.nil?
    c = @input.read(1)
    break
  end
  c&.ord
end

#hide_cursor

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 66

def hide_cursor
end

#move_cursor_column(val)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 72

def move_cursor_column(val)
end

#move_cursor_down(val)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 78

def move_cursor_down(val)
end

#move_cursor_up(val)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 75

def move_cursor_up(val)
end

#prep

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 101

def prep
end

#scroll_down(val)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 84

def scroll_down(val)
end

#set_default_key_bindings(_)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 28

def set_default_key_bindings(_)
end

#set_screen_size(rows, columns)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 90

def set_screen_size(rows, columns)
  @screen_size = [rows, columns]
end

#set_winch_handler(&handler)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 94

def set_winch_handler(&handler)
end

#show_cursor

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 69

def show_cursor
end

#ungetc(c)

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 54

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

#with_raw_input

[ GitHub ]

  
# File 'lib/reline/io/dumb.rb', line 35

def with_raw_input
  yield
end