Update debian/overrides + add debian/source/lintian-overrides
[grml-etc.git] / etc / skel / .irbrc
1 # Filename:      .irbrc
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 ################################################################################
8
9 # we want to be able to use tab-completion in irb:
10 require 'irb/completion'
11 ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
12
13 # we want to get a history file of our session:
14 module Readline
15   module History
16     LOG = "#{ENV['HOME']}/.irb-history"
17
18     def self.write_log(line)
19       File.open(LOG, 'ab') {|f| f << "#{line}\n"}
20     end
21
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") }
25     end
26   end
27
28   alias :old_readline :readline
29   def readline(*args)
30     ln = old_readline(*args)
31     begin
32       History.write_log(ln)
33     rescue
34     end
35     ln
36   end
37 end
38
39 Readline::History.start_session_log
40
41 # simple prompt?
42 # IRB.conf[:PROMPT_MODE] = :SIMPLE
43
44 # prompt for easy copy/paste? start with irb --prompt xmp
45 IRB.conf[:PROMPT][:XMP][:RETURN] = "\# => %s\n"
46
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
66
67 ## END OF FILE #################################################################