Sha256: 39a6797c38d2e01813b5c1e508bd57b696b3d604db74e5912432ad9473830cb2

Contents?: true

Size: 689 Bytes

Versions: 42

Compression:

Stored size: 689 Bytes

Contents

# snarfed from http://blog.nicksieger.com/articles/2006/04/23/tweaking-irb
module Readline
  module History
    @@log ||= File.join(Dir.pwd, 'console.log')
    
    def self.log= log
      @@log = log
    end
    
    def self.write_log(line)
      begin
        File.open(@@log, 'ab') {|f| f << "#{line}\n"}
      rescue
      end
    end 

    def self.start_session_log
      write_log("# session start: #{Time.now}")
      at_exit { write_log("# session stop: #{Time.now}\n") }
    end
  end

  alias :old_readline :readline
  def readline(*args)
    ln = old_readline(*args)
    History.write_log(ln)
    ln
  end
end

Readline::History.start_session_log

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
watir-classic-3.0.0 lib/watir-classic/irb-history.rb
watir-3.0.0.rc3 lib/watir/irb-history.rb
watir-3.0.0.rc2 lib/watir/irb-history.rb
watir-3.0.0.rc1 lib/watir/irb-history.rb
watir-2.0.4 lib/watir/irb-history.rb
watir-2.0.3 lib/watir/irb-history.rb
watir-2.0.2 lib/watir/irb-history.rb
watir-2.0.2.rc1 lib/watir/irb-history.rb
watir-2.0.1 lib/watir/irb-history.rb
watir-2.0.0 lib/watir/irb-history.rb
watir-2.0.0.rc3 lib/watir/irb-history.rb
watir-2.0.0.rc2 lib/watir/irb-history.rb
watir-1.9.2 lib/watir/irb-history.rb
watir-1.9.2.rc1 lib/watir/irb-history.rb
watir-1.9.1 lib/watir/irb-history.rb
watir-1.9.1.rc1 lib/watir/irb-history.rb
watir-1.9.0 lib/watir/irb-history.rb
watir-1.9.0.rc7 lib/watir/irb-history.rb
watir-1.9.0.rc6 lib/watir/irb-history.rb
watir-1.9.0.rc5 lib/watir/irb-history.rb