Skip to content

Commit

Permalink
Merge pull request #2331 from ima1zumi/irb-save-history
Browse files Browse the repository at this point in the history
Ruby 2.7.0からirbのSAVE_HISTORYがデフォルトになった
  • Loading branch information
hanachin authored Sep 15, 2020
2 parents 156b334 + 5968b2e commit a76ff13
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit a76ff13

Please sign in to comment.