GithubHelp home page GithubHelp logo

isabella232 / pry-stack_explorer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chef-boneyard/pry-stack_explorer

0.0 0.0 0.0 115 KB

Walk the stack in a Pry session

License: Other

Ruby 100.00%

pry-stack_explorer's Introduction

pry-stack_explorer

(C) John Mair (banisterfiend) 2011

Walk the stack in a Pry session

pry-stack_explorer is a plugin for the Pry REPL that enables the user to navigate the call-stack.

From the point a Pry session is started, the user can move up the stack through parent frames, examine state, and even evaluate code.

Unlike ruby-debug, pry-stack_explorer incurs no runtime cost and enables navigation right up the call-stack to the birth of the program.

pry-stack_explorer is currently designed to work on Rubinius and MRI Ruby 1.9.2+ (including 1.9.3). Support for other Ruby versions and implementations is planned for the future.

The up, down, frame and show-stack commands are provided. See Pry's in-session help for more information on any of these commands.

How to use:

After installing pry-stack_explorer, just start Pry as normal (typically via a binding.pry), the stack_explorer plugin will be detected and used automatically.

Example:

Here we run the following ruby script:

require 'pry-stack_explorer'

def alpha
  x = "hello"
  beta
  puts x
end

def beta
  binding.pry
end

alpha

We wander around the stack a little bit, and modify the state of a frame above the one we binding.pry'd at.

asciicast

Output from above is Goodbye as we changed the x local inside the alpha (caller) stack frame.

Limitations

  • First release, so may have teething problems.
  • Limited to Rubinius, and MRI 1.9.2+ at this stage.

Contact

Problems or questions contact me at github

License

(The MIT License)

Copyright (c) 2011 John Mair (banisterfiend)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pry-stack_explorer's People

Contributors

amatsuda avatar banister avatar brchristian avatar clintoncwolfe avatar conradirwin avatar grstearns avatar hanachin avatar kyrylo avatar moskyb avatar r-obert avatar rrosenblum avatar shawn42 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.