forked from bruce/linguistics
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.irbrc
35 lines (28 loc) · 1019 Bytes
/
.irbrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- ruby -*-
puts ">>> Adding 'lib' to load path..."
$LOAD_PATH.unshift( "lib" )
#puts ">>> Turning on $VERBOSE and $DEBUG..."
# $VERBOSE = $DEBUG = true
require './utils'
include UtilityFunctions
def colored( prompt, *args )
return ansiCode( *(args.flatten) ) + prompt + ansiCode( 'reset' )
end
# Modify prompt to do highlighting
IRB.conf[:PROMPT][:MUES] = { # name of prompt mode
:PROMPT_I => colored( "%N(%m):%03n:%i>", %w{bold white on_blue} ) + " ",
:PROMPT_S => colored( "%N(%m):%03n:%i%l", %w{white on_blue} ) + " ",
:PROMPT_C => colored( "%N(%m):%03n:%i*", %w{white on_blue} ) + " ",
:RETURN => " ==> %s\n\n" # format to return value
}
#IRB.conf[:PROMPT_MODE] = :MUES
# Try to require the 'mues' library
begin
puts "Requiring 'linguistics' module..."
require 'linguistics'
puts "Calling Linguistics::use( :en )"
Linguistics::use( :en, :installProxy => true )
rescue => e
$stderr.puts "Ack! Linguistics module failed to load: #{e.message}\n\t" +
e.backtrace.join( "\n\t" )
end