-
Notifications
You must be signed in to change notification settings - Fork 0
/
.irbrc
30 lines (22 loc) · 866 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
require 'irb/completion'
require 'pp'
IRB.conf[:AUTO_INDENT] = true
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
class Method; def open_in_vim; `mvim #{__file__}`; end; end
if File.exists?('script/console') && File.exists?('config/boot.rb')
unless Object.const_defined?("RAILS_ROOT")
require 'config/boot' unless Object.const_defined?("RAILS_ROOT")
require 'commands/console' if ENV['RAILS_ENV'].nil?
require File.join(RAILS_ROOT, 'config', 'environment')
end
puts "Rails #{Rails.version} #{RAILS_ENV} environment loaded."
end
def load_irbrc(path)
return if (path == ENV["HOME"]) || (path == '/')
load_irbrc(File.dirname path)
irbrc = File.join(path, ".irbrc")
load irbrc if File.exists?(irbrc)
end
load_irbrc Dir.pwd # probably should stay at the bottom