Created
February 25, 2010 01:38
-
-
Save akm/314114 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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