To avoid having to type that each time you load irb, you can put it in a
file named .irbrc, located in your home directory. I don't know what the
home directory is for Windows, but if you load irb and run `require 'etc';
Dir.home(Etc.getlogin)`, it will probably say (if that doesn't work, try
`ENV['HOME']`)
-Josh
···
On Mon, May 6, 2013 at 9:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:
Hi,
I've just started using Ruby today and I am reading through the tutorial
and the tutorial shows the code in the IRB with syntax highlighting.
I installed a gem called Wirble which is supposed to do that for me.
I used wirble when I first started exploring ruby and experimenting
with customizing irb. As josh mentioned you'll want to create a .irbrc
file which will be read and run when you execute irb in your shell.
You may want to dig deeper and explore how to configure your own color
theme as well which also would be put into the rc file as well.
If you are interested in an alternative repl to the ruby core irb
program pry is a decent option which has color on by default and some
vary exotic extentions in and unto itself with step debugging, emacs
like editing from the repl and manual help pages and code exploration
built in.
Enjoy your discovery of the language and happy hacking.
~Stu
···
On Mon, May 6, 2013 at 10:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:
Hi,
I've just started using Ruby today and I am reading through the tutorial
and the tutorial shows the code in the IRB with syntax highlighting.
I installed a gem called Wirble which is supposed to do that for me.
I'm writing Ruby code on Windows 7, and I use Notepad++
It does syntax highlighting and with a minor tweak you can set up a
shortcut key which will execute the code within the file you're
currently editing.
The best thing to do with that is usually write out your code in
Notepad++ and then copy-paste a line or block at a time into IRB.
That approach will make it easier to edit the code, as it can be awkward
recovering long lines of code from IRB after writing them in.
Sounds like you are looking for a syntax highlighting editor. I know that Sublime Text 2 and Notepad++ run on Windows and support code highlighting. There are likely many many others.
Robert Jackson
-- twitter: rwjblue
-- github: rjackson
···
On May 7, 2013, at 10:19 PM, Michael Tepfer <lists@ruby-forum.com> wrote:
Is there a free windows irb-like app that performs syntax highlighting
as the user types their input.