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 methodvim# starts VIM inside your IRB to edit multi-line codecopy "string"# copy something to your system clipboardmf [1,2,3], [3,2,1]# list methods that transform object1 into object2ls# list current directory contents~cd# change current directory to home directoryrq:mathn# short way of saying: require 'mathn'mof [1,2,3]# list methods for each module the object inherits fromhowtocall Open3, :popen3# print method signaturere "mail@janlelis.de", /\b([A-Z0-9._%+-]+)@([A-Z0-9.-]+\.[A-Z]{2,10})\b/i, 0..2# visualize a regexself.instance.set :a, 42# simple way to manipulate instance variables
There is a lot more. See the ReadMe file for further documentation!