Class: PryRemote::IOUndumpedProxy

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped
Defined in:
lib/pry-remote.rb

Overview

Class used to wrap inputs so that they can be sent through DRb.

This is to ensure the input is used locally and not reconstructed on the server by DRb.

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ IOUndumpedProxy

Returns a new instance of IOUndumpedProxy.



42
43
44
# File 'lib/pry-remote.rb', line 42

def initialize(obj)
  @obj = obj
end

Instance Method Details

#<<(data) ⇒ Object



83
84
85
86
# File 'lib/pry-remote.rb', line 83

def <<(data)
  @obj << data
  self
end

#completion_procObject



52
53
54
# File 'lib/pry-remote.rb', line 52

def completion_proc
  @obj.completion_proc if @obj.respond_to? :completion_proc
end

#completion_proc=(val) ⇒ Object



46
47
48
49
50
# File 'lib/pry-remote.rb', line 46

def completion_proc=(val)
  if @obj.respond_to? :completion_proc=
    @obj.completion_proc = val
  end
end


71
72
73
# File 'lib/pry-remote.rb', line 71

def print(*objs)
  @obj.print(*objs)
end

#printf(*args) ⇒ Object



75
76
77
# File 'lib/pry-remote.rb', line 75

def printf(*args)
  @obj.printf(*args)
end

#puts(*lines) ⇒ Object



67
68
69
# File 'lib/pry-remote.rb', line 67

def puts(*lines)
  @obj.puts(*lines)
end

#readline(prompt) ⇒ Object



56
57
58
59
60
61
62
63
64
65
# File 'lib/pry-remote.rb', line 56

def readline(prompt)
  if Readline == @obj
    @obj.readline(prompt, true)
  elsif @obj.method(:readline).arity == 1
    @obj.readline(prompt)
  else
    $stdout.print prompt
    @obj.readline
  end
end

#tty?Boolean

Some versions of Pry expect $stdout or its output objects to respond to this message.

Returns:

  • (Boolean)


90
91
92
# File 'lib/pry-remote.rb', line 90

def tty?
  false
end

#write(data) ⇒ Object



79
80
81
# File 'lib/pry-remote.rb', line 79

def write(data)
  @obj.write data
end