Setup

Add to your project's Gemfile

gem ' irbtools ' , require: ' irbtools/binding '

Add to ~/.irbrc

require ' irbtools '

Usage

Put binding.irb in your code to start a new IRB session. Then try the following things in your enhanced IRB:

code :ls # list the source of a Ruby method

# list the source of a Ruby method vim # starts VIM inside your IRB to edit multi-line code

# starts VIM inside your IRB to edit multi-line code copy "string" # copy something to your system clipboard

# copy something to your system clipboard mf [1,2,3], [3,2,1] # list methods that transform object1 into object2

# list methods that transform object1 into object2 ls # list current directory contents

# list current directory contents ~cd # change current directory to home directory

# change current directory to home directory rq:mathn # short way of saying: require 'mathn'

# short way of saying: require 'mathn' mof [1,2,3] # list methods for each module the object inherits from

# list methods for each module the object inherits from howtocall Open3, :popen3 # print method signature

# print method signature re "mail@janlelis.de", /\b([A-Z0-9._%+-]+)@([A-Z0-9.-]+\.[A-Z]{2,10})\b/i, 0..2 # visualize a regex

# visualize a regex self.instance.set :a, 42 # simple way to manipulate instance variables

There is a lot more. See the ReadMe file for further documentation!