-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.irbrc
36 lines (31 loc) · 890 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
36
#load libraries
require 'rubygems' rescue nil
require 'wirble'
require 'hirb'
require 'logger'
#Load wirble
Wirble.init
Wirble.colorize
# hirb (active record output format in table)
Hirb::View.enable
Hirb::Formatter.dynamic_config['ActiveRecord::Base']
# IRB Options
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:EVAL_HISTORY] = 200
# Log to STDOUT if in Rails
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
IRB.conf[:USE_READLINE] = true
# Display the RAILS ENV in the prompt
# ie : [Development]>>
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_N => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
:PROMPT_I => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
:PROMPT_S => nil,
:PROMPT_C => "?> ",
:RETURN => "=> %s\n"
}
# Set default prompt
IRB.conf[:PROMPT_MODE] = :CUSTOM
end