-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.irbrc
44 lines (34 loc) · 941 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
37
38
39
40
41
42
43
44
# frozen_string_literal: true
# Awesome print
begin
require 'awesome_print'
AwesomePrint.irb!
rescue LoadError => err
warn "Couldn't load awesome_print: #{err}"
end
# IRB
require 'irb/completion'
ARGV.concat %w[--readline --prompt-mode simple]
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:EVAL_HISTORY] = 1000
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = File.expand_path('.irbrc_history')
# Rails
railsrc_path = File.expand_path('.irbrc_rails')
if (ENV['RAILS_ENV'] || defined?(Rails)) && File.exist?(railsrc_path)
begin
load railsrc_path
rescue Exception => err
warn "Could not load: #{railsrc_path} because of #{err}"
end
end
# Object
class Object
def interesting_methods
case self.class
when Class then public_methods.sort - Object.public_methods
when Module then public_methods.sort - Module.public_methods
else public_methods.sort - Object.new.public_methods
end
end
end