I'm using a short bash script to help me test an implementation of linked lists in ruby for class. I know about rspec and unit testing, and I'm certain they're better options for what I'm trying to do, but I was able to figure out this command
echo "require './nodes'" | irb
The output afterwards is
Switch to inspect mode.
require './nodes'
true
Technically a success, but the irb process ends there. So I tried
echo "require './nodes'" | irb --noinspect
Which gave me
Switch to non inspect mode.
require './nodes'
true
And it again exits the irb process.
I'm just trying to make my workflow a little bit more convenient, as I like to use irb to test my files by poking around at them and seeing what happens.
Create a simple script, the code below will land you into the
irb
shell with the 'nodes' gem included. If you are using Ruby 1.8.x then you'll need to addrequire 'rubygems'
before requiring nodes gem