forked from peikk0/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pryrc
46 lines (39 loc) · 1.24 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
46
# -*- mode: ruby -*- vim:set ft=ruby:
# courtesy of tpope (http://github.com/tpope/tpope/blob/master/.pryrc)
ENV['HOME'] ||= ENV['USERPROFILE'] || File.dirname(__FILE__)
Pry.editor = ENV['VISUAL']
Pry.config.history.file = File.expand_path('~/.history.rb')
begin
if defined?(Bundler)
FileUtils.mkdir_p('.bundle')
Pry.config.history.file = Bundler.root.join('.bundle/history.rb')
end
rescue
end
Pry.config.history.should_load = true
Pry.config.history.should_save = true
# gem install pry-theme
Pry.config.theme = "solarized"
Pry.config.print = proc do |output, value|
output.puts "\001\e[1;32m\002<\001\e[0m\002 #{value.inspect}"
end
Pry.config.exception_handler = proc do |output, exception, _|
output.puts "\001\e[1;31m\002<\001\e[0m\002 #{exception.class}: #{exception.message}"
output.puts "from #{exception.backtrace.first}"
end
Pry.prompt = [
proc do |target_self, nest_level, pry|
"\001\e[1;34m\002#{'>' * (nest_level + 1)}\001\e[0m\002 "
end,
proc do |target_self, nest_level, pry|
"#{' ' * nest_level}\001\e[1;30m\002┇\001\e[0m\002 "
end
]
$LOAD_PATH.unshift(File.expand_path('~/.ruby/lib'), File.expand_path('~/.ruby'))
$LOAD_PATH.uniq!
%w(pry-editline).each do |lib|
begin
require lib
rescue LoadError
end
end