Code Monkey home page Code Monkey logo

pry-remote's Introduction

What is it?

A way to start Pry remotely and to connect to it using DRb. This allows to access the state of the running program from anywhere.

Installation

gem install pry-remote

Usage

Here's a program starting pry-remote:

require 'pry-remote'

class Foo
  def initialize(x, y)
    binding.remote_pry
  end
end

Foo.new 10, 20

Running it will prompt you with a message telling you Pry is waiting for a program to connect itself to it:

 [pry-remote] Waiting for client on drb://localhost:9876

You can then connect yourself using pry-remote:

$ pry-remote
From: example.rb @ line 7 in Foo#initialize:
     2:
     3: require 'pry-remote'
     4:
     5: class Foo
     6:   def initialize(x, y)
 =>  7:     binding.remote_pry
     8:   end
     9: end
    10:
    11: Foo.new 10, 20
pry(#<Foo:0x00000000d9b5e8>):1> self
=> #<Foo:0x1efb3b0>
pry(#<Foo:0x00000001efb3b0>):2> ls -l
Local variables: [
  [0] :_,
  [1] :_dir_,
  [2] :_file_,
  [3] :_ex_,
  [4] :_pry_,
  [5] :_out_,
  [6] :_in_,
  [7] :x,
  [8] :y
]
pry(#<Foo:0x00000001efb3b0>):3> ^D

pry-remote's People

Contributors

mon-ouie avatar shadowbq avatar banister avatar findchris avatar afazio avatar cwoodcox avatar fb3 avatar

Watchers

Siong avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.