Class: PryRemote::IOUndumpedProxy
- 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
- #<<(data) ⇒ Object
- #completion_proc ⇒ Object
- #completion_proc=(val) ⇒ Object
-
#initialize(obj) ⇒ IOUndumpedProxy
constructor
A new instance of IOUndumpedProxy.
- #print(*objs) ⇒ Object
- #puts(*lines) ⇒ Object
- #readline(prompt) ⇒ Object
-
#tty? ⇒ Boolean
Some versions of Pry expect $stdout or its output objects to respond to this message.
- #write(data) ⇒ Object
Constructor Details
#initialize(obj) ⇒ IOUndumpedProxy
42 43 44 |
# File 'lib/pry-remote.rb', line 42 def initialize(obj) @obj = obj end |
Instance Method Details
#<<(data) ⇒ Object
77 78 79 80 |
# File 'lib/pry-remote.rb', line 77 def <<(data) @obj << data self end |
#completion_proc ⇒ Object
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 |
#print(*objs) ⇒ Object
69 70 71 |
# File 'lib/pry-remote.rb', line 69 def print(*objs) @obj.print(*objs) end |
#puts(*lines) ⇒ Object
65 66 67 |
# File 'lib/pry-remote.rb', line 65 def puts(*lines) @obj.puts(*lines) end |
#readline(prompt) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/pry-remote.rb', line 56 def readline(prompt) if @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.
84 85 86 |
# File 'lib/pry-remote.rb', line 84 def tty? false end |
#write(data) ⇒ Object
73 74 75 |
# File 'lib/pry-remote.rb', line 73 def write(data) @obj.write data end |