Pry (software)

Last updated
Pry REPL
Developer(s) John Mair (banisterfiend), Conrad Irwin, …many more
Stable release
0.11.1 / September 26, 2017 (2017-09-26)
Repository
Written in Ruby
Operating system Cross-platform
Platform Ruby interpreter
Type Ruby shell
License
MIT License
Website pry.github.io

Pry is an interactive shell for the Ruby programming language. It is notable for its Smalltalk-inspired [1] ability to start a REPL within a running program. This lets programmers debug and modify the current state of a system.

Contents

Features

Pry exposes most of its introspective capabilities using a filesystem metaphor. [2] For example, it has a cd command to start interacting with a particular object, and uses ls to list methods and variables.

It is possible to start Pry at any point inside a running program. [3] Due to the reflective nature of Ruby, this lets the programmer inspect the program, change its current state, or correct the source code without restarting the process.

A number of third party plugins are available for Pry, [1] these add tighter integration with other Ruby projects, enhance the abilities of Pry itself, and make Pry available over a remote connection.

See also

Related Research Articles

An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or both; others, such as SharpDevelop and Lazarus, do not.

<span class="mw-page-title-main">Ruby (programming language)</span> General-purpose programming language

Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

<span class="mw-page-title-main">Smalltalk</span> Object-oriented programming language first released in 1972

Smalltalk is a purely object oriented programming language (OOP), created in the 1970s for educational use, specifically for constructionist learning, at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

<span class="mw-page-title-main">Debugger</span> Computer program used to test and debug other programs

A debugger or debugging tool is a computer program used to test and debug other programs. The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its execution and monitor changes in computer resources that may indicate malfunctioning code. Typical debugging facilities include the ability to run or halt the target program at specific points, display the contents of memory, CPU registers or storage devices, and modify memory or register contents in order to enter selected test data that might be a cause of faulty program execution.

<span class="mw-page-title-main">Interpreter (computing)</span> Program that executes source code without a separate compilation step

In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An interpreter generally uses one of the following strategies for program execution:

  1. Parse the source code and perform its behavior directly;
  2. Translate source code into some efficient intermediate representation or object code and immediately execute that;
  3. Explicitly execute stored precompiled bytecode made by a compiler and matched with the interpreter Virtual Machine.

A programming tool or software development tool is a computer program that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs, that can be combined to accomplish a task, much as one might use multiple hands to fix a physical object. The most basic tools are a source code editor and a compiler or interpreter, which are used ubiquitously and continuously. Other tools are used more or less depending on the language, development methodology, and individual engineer, often used for a discrete task, like a debugger or profiler. Tools may be discrete programs, executed separately – often from the command line – or may be parts of a single large program, called an integrated development environment (IDE). In many cases, particularly for simpler use, simple ad hoc techniques are used instead of a tool, such as print debugging instead of using a debugger, manual timing instead of a profiler, or tracking bugs in a text file or spreadsheet instead of a bug tracking system.

Metaprogramming is a programming technique in which computer programs have the ability to treat other programs as their data. It means that a program can be designed to read, generate, analyze or transform other programs, and even modify itself while running. In some cases, this allows programmers to minimize the number of lines of code to express a solution, in turn reducing development time. It also allows programs a greater flexibility to efficiently handle new situations without recompilation.

<span class="mw-page-title-main">Macintosh Programmer's Workshop</span> Software development package for the Classic Mac OS

Macintosh Programmer's Workshop (MPW) is a software development environment for the Classic Mac OS operating system, written by Apple Computer. For Macintosh developers, it was one of the primary tools for building applications for System 7.x and Mac OS 8.x and 9.x. Initially MPW was available for purchase as part of Apple's professional developers program, but Apple made it a free download after it was superseded by CodeWarrior. On Mac OS X it was replaced by the Project Builder IDE, which eventually became Xcode.

<span class="mw-page-title-main">Breakpoint</span> Debugging method used in software development

In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause.

A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise. The term usually refers to programming interfaces similar to the classic Lisp machine interactive environment. Common examples include command-line shells and similar environments for programming languages, and the technique is very characteristic of scripting languages.

<span class="mw-page-title-main">Seaside (software)</span> Smalltalk web framework

Seaside, an acronym that stands for “Squeak Enterprise Aubergines Server with Integrated Development Environment,” is computer software, a web framework to develop web applications in the programming language Small talk. It is distributed as free and open-source software under an MIT License.

Apple Dylan is the original implementation of the programming language Dylan. It was developed by Apple Computer from 1992 to 1995.

Exploratory programming, as opposed to implementation (programming), is an important part of the software engineering cycle: when a domain is not very well understood or open-ended, or it's not clear what algorithms and data structures might be needed for an implementation, it's useful to be able to interactively develop and debug a program without having to go through the usual constraints of the edit-compile-run-debug cycle. Languages such as APL, Cecil, C#, Dylan, Factor, Forth, F#, J, Java, Julia, Lisp, Mathematica, Obliq, Oz, Prolog, Python, REBOL, Perl, R, Ruby, Scala, Self, Smalltalk, Tcl, and JavaScript, often in conjunction with an IDE, provide support for exploratory programming via interactivity, dynamicity, and extensibility.

<span class="mw-page-title-main">Open Cobalt</span> Software for creating virtual worlds

Open Cobalt is a free and open-source software platform for constructing, accessing, and sharing virtual worlds both on local area networks or across the Internet, with no need for centralized servers.

<span class="mw-page-title-main">Scripting language</span> Programming language for run-time events

A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.


The Wing Python IDE family of integrated development environments (IDEs) from Wingware was created specifically for the Python programming language, with support for editing, testing, debugging, inspecting/browsing, and error checking Python code.

In computer programming and software development, debugging is the process of finding and resolving bugs within computer programs, software, or systems.

References

  1. 1 2 The Pry Ecosystem — John Mair, 2012 link
  2. Pry — Reuven M. Lerner, LinuxJournal, July 2012, pp28 link, or
  3. Interactive Debugging With Pry — Alan MacDougall, 2012 link, or