2 # Purpose: configuration file for irb (interactive ruby)
3 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 # Bug-Reports: see http://grml.org/bugs/
5 # License: This file is licensed under the GPL v2.
6 # Latest change: Die Sep 26 23:16:29 CEST 2006 [mika]
7 ################################################################################
9 # we want to be able to use tab-completion in irb:
10 require 'irb/completion'
11 ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
13 # we want to get a history file of our session:
16 LOG = "#{ENV['HOME']}/.irb-history"
18 def self.write_log(line)
19 File.open(LOG, 'ab') {|f| f << "#{line}\n"}
22 def self.start_session_log
23 write_log("\n# session start: #{Time.now}\n\n")
24 at_exit { write_log("\n# session stop: #{Time.now}\n") }
28 alias :old_readline :readline
30 ln = old_readline(*args)
39 Readline::History.start_session_log
42 # IRB.conf[:PROMPT_MODE] = :SIMPLE
44 # prompt for easy copy/paste? start with irb --prompt xmp
45 IRB.conf[:PROMPT][:XMP][:RETURN] = "\# => %s\n"
47 # copy/paste from manpage:
48 # IRB.conf[:IRB_NAME]="irb"
49 # IRB.conf[:MATH_MODE]=false
50 # IRB.conf[:USE_TRACER]=false
51 # IRB.conf[:USE_LOADER]=false
52 # IRB.conf[:IGNORE_SIGINT]=true
53 # IRB.conf[:IGNORE_EOF]=false
54 # IRB.conf[:INSPECT_MODE]=nil
55 # IRB.conf[:IRB_RC] = nil
56 # IRB.conf[:BACK_TRACE_LIMIT]=16
57 # IRB.conf[:USE_LOADER] = false
58 # IRB.conf[:USE_READLINE] = nil
59 # IRB.conf[:USE_TRACER] = false
60 # IRB.conf[:IGNORE_SIGINT] = true
61 # IRB.conf[:IGNORE_EOF] = false
62 # IRB.conf[:PROMPT_MODE] = :DEFALUT
63 # IRB.conf[:PROMPT] = {...}
64 # IRB.conf[:DEBUG_LEVEL]=0
65 # IRB.conf[:VERBOSE]=true
67 ## END OF FILE #################################################################