Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between the ruby irb prompt modes?

Tags:

ruby

irb

I can change the irb prompt mode with

irb --prompt prompt-mode

I can see what null and simple does, but I can't tell the difference between null and xmp and the difference between default/classic/inf-ruby. Can someone explain to me what these other modes do? It seems pointless to have multiple modes doing the same thing.

like image 387
Steven Avatar asked Dec 12 '22 23:12

Steven


1 Answers

Once you read the article cldwalker posted above, you may want to design a custom prompt, here's mine for example:

IRB.conf[:PROMPT][:CUSTOM] = {
  :PROMPT_I => ">> ",
  :PROMPT_S => "%l>> ",
  :PROMPT_C => ".. ",
  :PROMPT_N => ".. ",
  :RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
IRB.conf[:AUTO_INDENT] = true
like image 166
Michael Kohl Avatar answered Jan 05 '23 12:01

Michael Kohl