binding.repl

Build Status
Code Climate

"binding.pry" for every ruby repl.

Features

  • Start the repl pry, irb, ripl, rib or ir at runtime
  • Auto-discover and start the first found repl at runtime
  • Require of a repl is delayed until you call "binding.repl.<repl name>"
  • Require of a repl is never duplicated
  • Easily extended to support new repls

Examples

1.

An example of how you can start a repl of your choice in a sinatra web application:

get "/greet" do
  binding.repl.{pry,irb,ripl,rib,ir}
  ["hello", "hola"].sample
end

2.

Auto-discover and start the first found repl:

class Apple
  # auto discover and start the first found repl.
  binding.repl.auto

  # same as 'binding.repl.auto' but with less characters to type.
  binding.repl!
end

Install

rubygems:

gem install binding.repl

git:

git clone https://github.com/rpag/binding.repl.git
cd binding.repl
gem build binding.repl.gemspec
gem install *.gem

License

See MIT-LICENSE.txt file.