forked from amarshall/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpryrc
45 lines (36 loc) · 1.2 KB
/
pryrc
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
45
# Load plugins (only those I whitelist)
Pry.config.should_load_plugins = false
Pry.plugins["doc"].activate!
prompt = proc do |indicator, target_self, nest_level, pry|
line = '%02d' % pry.input_array.size
nesting = ":#{nest_level}" unless nest_level.zero?
"[#{line}] pry(#{Pry.view_clip(target_self)})#{nesting}#{indicator} "
end
Pry.config.prompt = [prompt.curry['>'], prompt.curry['*']]
Pry.config.print = proc do |output, value|
indicator = Pry::Helpers::Text.green('→')
output.puts "#{indicator} #{value.inspect}"
end
Pry.config.exception_handler = proc do |output, exception, _|
display = ->(text) { output.puts Pry::Helpers::Text.yellow(text) }
backtrace = exception.backtrace.map do |line|
if match = line.match(/.*\/\d\.\d\.\d\/(.+)/)
".../#{match.captures.first}"
else
line
end
end.reject.with_index do |line, index|
index != 0 && line =~ /gems\/(pry|zeus|rspec)/
end
display.(exception.inspect)
backtrace.each do |line|
display.(" #{line}")
end
end
if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
end
Pry.config.theme = 'solarized'
load '~/.rbrc'