Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby 2.7.0からirbのSAVE_HISTORYがデフォルトになった #2331

Merged
merged 2 commits into from
Sep 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions refm/api/src/irb.rd
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ irb コマンドのオプションを指定したのと同じ効果が得られ
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
#@since 2.7.0
IRB.conf[:SAVE_HISTORY] = 1000
#@else
IRB.conf[:SAVE_HISTORY] = nil
#@end
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
Expand Down Expand Up @@ -627,13 +631,22 @@ irb はシンボルであるかどうかの判断を間違えることがあり

===[a:history] 履歴の保存

#@since 2.7.0
デフォルトで、実行結果の履歴1000件が ~/.irb_history に保存されます。

もし履歴を保存したくない場合は、.irbrc で以下のように指定します。

IRB.conf[:SAVE_HISTORY] = nil

#@else
さらに、.irbrc で以下のように
conf.save_history の値を指定しておくと、
実行結果の履歴がファイルに保存されます。

IRB.conf[:SAVE_HISTORY] = 100

履歴ファイルの名前はデフォルトでは ~/.irb_history です。
#@end
履歴ファイルの名前は IRB.conf[:HISTORY_FILE] で指定できます。

#@since 1.9.2
Expand Down