-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pryrc
42 lines (35 loc) · 1.04 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
# We do this here as well in case pry was not started through IRB,
# but for example from rails console with pry being in the Gemfile
$LOAD_PATH.push(*Dir["#{ENV['HOME']}/.prygems/gems/*/lib"]).uniq!
# Further Pry configuration
PLUGINS = %w[
pry-doc
pry-byebug
awesome_print
readline
]
# pry-remote
# pry-stack_explorer
# pry-git
PLUGINS.each do |name|
begin
require name
rescue LoadError
puts "\e[31mFailed\e[0m loading '#{name}'"
@load_error = true
end
end
if @load_error
puts "\e[2mInstall them with `gem` or add them in `bundler` (if needed)\e[0m"
end
# Sublime Text FTW
Pry.config.editor = "subl -w"
# My pry is polite
Pry.config.hooks.add_hook(:after_session, :say_bye) do
puts "bye-bye"
end
# Prompt with ruby version
Pry.prompt = [
proc { |obj, nest_level, pry| "[#{pry.input_ring.size}] #{RUBY_ENGINE}-#{RUBY_VERSION} (#{obj})#{":#{nest_level}" if nest_level > 0}> " },
proc { |obj, nest_level, pry| "[#{pry.input_ring.size}] #{RUBY_ENGINE}-#{RUBY_VERSION} (#{obj})#{":#{nest_level}" if nest_level > 0}* " }
]