Module: IRB::History
- Defined in:
- lib/irb/history.rb
Constant Summary collapse
- DEFAULT_ENTRY_LIMIT =
1000
Class Method Summary collapse
-
.history_file ⇒ Object
Might be nil when HOME and XDG_CONFIG_HOME are not available.
- .infinite? ⇒ Boolean
-
.save_history ⇒ Object
Integer representation of
IRB.conf[:HISTORY_FILE]
. - .save_history? ⇒ Boolean
Class Method Details
permalink .history_file ⇒ Object
Might be nil when HOME and XDG_CONFIG_HOME are not available.
24 25 26 27 28 29 30 |
# File 'lib/irb/history.rb', line 24 def history_file if (history_file = IRB.conf[:HISTORY_FILE]) File.(history_file) else IRB.rc_file("_history") end end |
permalink .infinite? ⇒ Boolean
19 20 21 |
# File 'lib/irb/history.rb', line 19 def infinite? save_history.negative? end |
permalink .save_history ⇒ Object
Integer representation of IRB.conf[:HISTORY_FILE]
.
9 10 11 12 13 |
# File 'lib/irb/history.rb', line 9 def save_history return 0 if IRB.conf[:SAVE_HISTORY] == false return DEFAULT_ENTRY_LIMIT if IRB.conf[:SAVE_HISTORY] == true IRB.conf[:SAVE_HISTORY].to_i end |
permalink .save_history? ⇒ Boolean
15 16 17 |
# File 'lib/irb/history.rb', line 15 def save_history? !save_history.zero? end |