-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathirbrc
More file actions
33 lines (30 loc) · 677 Bytes
/
irbrc
File metadata and controls
33 lines (30 loc) · 677 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
29
30
31
32
33
%w(looksee pry ap).each do |_gem|
begin
require _gem
rescue LoadError => e
warn e.message
end
end
if ( ENV['RAILS_ENV'] || defined? Rails )
begin
require 'hirb'
Hirb.enable
rescue LoadError => e
warn e.message
end
end
if defined?(Pry)
Pry.start
exit
else
require 'irb/completion'
prompt = "\033[1;30m#{RUBY_VERSION}\033[0m"
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_C => "#{prompt} \033[0;36m?>\033[0m ",
:RETURN => "=> %s\n",
:PROMPT_I => "#{prompt} \033[0;36m>>\033[0m ",
:PROMPT_N => "#{prompt} \033[0;36m>>\033[0m ",
:PROMPT_S => nil }
IRB.conf[:PROMPT_MODE] = :CUSTOM
end