-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_irbrc
More file actions
28 lines (24 loc) · 841 Bytes
/
dot_irbrc
File metadata and controls
28 lines (24 loc) · 841 Bytes
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
# Based on:
# https://github.com/jordansissel/dotfiles/blob/master/.irbrc
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
# Just for Rails...
if ENV['IRB_PROMPT'] and ENV['RAILS_ENV']
IRB.conf[:PROMPT] ||= {}
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_I => "#{ENV['IRB_PROMPT']}/irb> ",
:PROMPT_S => "#{ENV['IRB_PROMPT']}/irb* ",
:PROMPT_C => "#{ENV['IRB_PROMPT']}/irb? ",
:RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
# Called after the irb session is initialized and Rails has
# been loaded (props: Mike Clark).
IRB.conf[:IRB_RC] = Proc.new do
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.instance_eval { alias :[] :find }
end
end