For those who haven’t used DrScheme, window is split in two parts: one part is a file you’re editing, and the other is interactive shell. When I run a file, it is loaded into interactive environment, so I can invoke functions I’ve defined etc. Interactive environment still has all the features of text editor (syntax highlighting, auto completion, etc…)
So is there an IDE for Ruby that doesn’t just execute script I’m making, but loads it into irb instead, with all text editor goodies?
This exact request (even up to the fact that Dr Scheme motivated it) is what finally pushed me to learn Emacs.
Here’s what i did to install it under Windows Vista:
Download Emacs from http://ftp.gnu.org/gnu/windows/emacs/emacs-22.3-bin-i386.zip
Unzip it to the directory of your choice
After unzipping it create an includes directory anywhere you wish and copy there both ruby-mode.el and ruby-inf.el (these come with the ruby distribution under the misc directory and can also be downloaded from Ruby’s source
Modify your .emacs to tell it where to find your includes and and to use them
(optional) I also installed mode-compile.el from http://perso.tls.cena.fr/boubaker/distrib/mode-compile.el and made the corresponding edits in .emacs
With those changes Emacs will automatically identify a .rb file as ruby and do syntax highlighting. Then with the chord \C-c\C-s (Control-c, release and then Control-s) irb will start in the box below your file, and you can use all the keys defined by inf-ruby: (\M is the Meta Key which for Windows means Alt)
If you did the optional step and installed mode-compile, you can also use \C-cc to send the current file to ruby instead of irb