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