Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple Rubies using RVM or RBENV.
Note: This is NOT the same as multiruby although multiruby has similar uses for fuller scripts and may be worth checking out.
Why is this useful?
If you're a regular developer, it's probably not very useful. But if you're researching or training people in the differences between versions and implementations of Ruby, it could be very helpful indeed.
This system was used in a different form in the Ruby 1.9 Walkthrough and is now being used to develop the Ruby 2.0 Walkthrough. Multirb allows me to quickly demonstrate the ways in which different versions of Ruby handle or support various features.
$ gem install multirb
Note: multirb works fine from MRI Ruby 1.9 and JRuby 1.7.x but has not been tested elsewhere yet.
Or if you want to specify some different 'default' versions of Ruby to run:
$ multirb 1.9.2 1.9.3 [etc..]
- Type in expressions and press Enter.
- Leave whitespace on the end of lines to enter more lines.
# allto run all versions, nothing for default.
# version,version,versionto run specific versions (e.g.
# 1.9.2, 1.9.3.)
exiton its own to exit (or use Ctrl+D.)
Currently specifies jruby, 1.8.7, 1.9.2, 1.9.3, 2.0.0, and 2.1.2 as 'all versions'; 1.8.7, 1.9.3, 2.0.0, and 2.1.2 as 'default versions'.
0.0.6 (current gem release)
- add ruby 2.1.2 to all and default
- fixes a Ruby version detection bug triggered by interpolation (found by dalton)
- rbenv support
- acts nicely when using Ctrl+D to exit rather than raising a needless error
- uses Ruby 2.0.0-rc2 as a default
- Uses threads to speed up results (thanks to Ismael Abreu for initial implementation)
- Improved 'tempfile' usage to prevent errors on JRuby
- Initial version
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request