Skip to content

Instantly share code, notes, and snippets.

@akm
Created February 25, 2010 01:38
Show Gist options
  • Save akm/314114 to your computer and use it in GitHub Desktop.
Save akm/314114 to your computer and use it in GitHub Desktop.
# http://doc.loveruby.net/refm/api/view/library/irb
# プロンプトモードは :DEFAULT の他に :NULL, :CLASSIC, :SIMPLE, :XMP が定義されています。
# 実行時には
# IRB.conf[:PROMPT].keys
# で確認できます。
# irb中で、
# conf.prompt_mode = :CODE
# とかすれば、モードの変更ができます。
IRB.conf[:PROMPT_MODE] = :SIMPLE
if IRB.conf[:PROMPT]
IRB.conf[:PROMPT][:CODE] = {
:PROMPT_I => "",
:PROMPT_N => "",
:PROMPT_S => "#=> ",
:PROMPT_C => nil,
:RETURN => "#=> %s\n"
}
def codemode!
conf.prompt_mode = :CODE
end
IRB.conf[:PROMPT][:SIMPLE_IRB] = {
:PROMPT_I => "irb> ",
:PROMPT_N => "irb> ",
:PROMPT_S => nil,
:PROMPT_C => "irb> ",
:RETURN => "=> %s\n"
}
def simple_irb_mode!
conf.prompt_mode = :SIMPLE_IRB
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment