- Posted by Shay Friedman on October 1, 2009
I talked with Ariel today and recommended him my favorite Ruby editor for small scripts and apps – SciTE.
The nice thing about SciTE is the ability to run your script file from the application via the F5 key. Since we were talking about IronRuby, SciTE gave us good syntax highlighting and auto-completion features, but we couldn’t execute our code on the IronRuby interpreter.
BUT… this is a problem of the past now! with a few simple steps, you can turn your SciTE environment to an IronRuby stupendous development environment! or at least make it use the IronRuby interpreter…
Now, to the job:
- Open SciTE.
- Go to Options->Open ruby.properties:
- A file with a lot of settings will be opened inside the editor window. Look for the text “ruby $(FileNameExt)” (I have it on line 108 and 116).
- Change “ruby $(FileNameExt)” to “ir $(FileNameExt)” on both places (if you’re on Windows, changing the first one will be enough):
Pay attention that there is the rbw line (look at line 110 on the image). I haven’t changed it because it’s not that common to use rbw files and also IronRuby doesn’t have the option as far as I know… I just left it there to use the regular MRI interpreter.
If you want to make sure that every Ruby file on SciTE environment is run via IronRuby, change “rubyw $(FileNameExt)” to “ir $(FileNameExt)” as well.
You must have ir.exe defined in your PATH environment variable in order for this to work. It is a good practice to do that, but if you don’t want to, just write the full path to ir.exe instead of just “ir”.
- Save the file.
That’s it, your’re done! now go and create an rb file and hit F5. IronRuby will run your script now.