Module: Readline::Hist
- Defined in:
- lib/reo_console.rb
Overview
:nodoc: #
Constant Summary collapse
- LOG =
IRB.conf[:HISTORY_FILE]
Class Method Summary collapse
- .start_session_log ⇒ Object
-
.write_log(line) ⇒ Object
LOG = “#'HOME'/.irb-history”.
Class Method Details
.start_session_log ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/reo_console.rb', line 30 def self.start_session_log = proc{ Time.now.strftime("%Y-%m-%d, %H:%M:%S")} class << # :nodoc: # alias to_s call end write_log( "###### session start: #{timestamp}") at_exit { write_log("###### session stop: #{timestamp}") } end |
.write_log(line) ⇒ Object
LOG = “#'HOME'/.irb-history”
25 26 27 28 |
# File 'lib/reo_console.rb', line 25 def self.write_log(line) File.open(LOG, 'ab') {|f| f << "#{line} "} end |