Class: Pry::Shell::Session
- Inherits:
-
Object
- Object
- Pry::Shell::Session
- Defined in:
- lib/pry/shell/session.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object, host, port, with_byebug) ⇒ Session
constructor
A new instance of Session.
- #run ⇒ Object
Constructor Details
#initialize(object, host, port, with_byebug) ⇒ Session
Returns a new instance of Session.
21 22 23 24 25 26 |
# File 'lib/pry/shell/session.rb', line 21 def initialize(object, host, port, with_byebug) @object = object @host = host @port = port @with_byebug = with_byebug end |
Class Method Details
.run(object, host:, port:, with_byebug:) ⇒ Object
16 17 18 |
# File 'lib/pry/shell/session.rb', line 16 def run(object, host:, port:, with_byebug:) new(object, host, port, with_byebug).run end |
Instance Method Details
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pry/shell/session.rb', line 28 def run Shell. = Pry.start(object, ) rescue DRb::DRbConnError puts "DRb connection failed!" ensure # Since we run `Byebug.current_context.step_out` this ensure # block already runs and clears the options which are necessary # to setup the Byebug. # We are clearing this options in `PryShellProcessor` to ensure # they do not leak. unless enable_byebug? [:remove_connection].call Shell. end end |