Twice this weekend I’ve found that I would like to drop from a script into the interactive prompt and have the environment and context available to debug and test. Once in Ruby and once in Python.

I do most active development with an interpreter open, but copying and pasting into the interpreter quickly becomes tedious.

import pdb
# ...
require 'rubygems'
require 'ruby-debug'
# ...

I will certainly be using these extensively at the very least to test my data-structures.

Update 2012-10-11

Alternative with Pry:

require 'pry'
# ...