tags:

views:

468

answers:

3

Hi, Ruby is preinstalled on my Mac and so I wanted to have a look at it. First thing I noticed, is that irb prompts >> instead of irb(main):001:0>. I can't find anything on how to change this with Google because everyone is using irb(main):001:0> in their code ;-)

Can you help me out?

PS: It's not that I think Ruby is broken, but I want to look more nerdy while programming ;-)

+5  A: 
$ irb --help
Usage:  irb.rb [options] [programfile] [arguments]
  --prompt prompt-mode
  --prompt-mode prompt-mode
         Switch prompt mode. Pre-defined prompt modes are
         `default', `simple', `xmp' and `inf-ruby'
troelskn
+4  A: 

Answer: irb --prompt inf-ruby

Regurgitating docs is rarely helpful and in fact is quite insulting. You're basically saying RTFM; you're assuming the person is too stupid to have actually tried reading the docs. If someone is asking a question let's just assume they looked at the docs and found them confusing so needed clarification.

There have been many times when I've read docs and in even the most simple of definitions they use the word being defined in the definition, assuming we already know the definition, and then go into indecipherable option listings.

So, let's keep it positive and give answers.

Mike Bethany