-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pryrc
37 lines (31 loc) · 1.01 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
# Editor
Pry.editor = "code-insiders --wait"
# Config
Pry.config.ls.separator = "\n" # new lines between methods
Pry.config.ls.heading_color = :magenta
Pry.config.ls.public_method_color = :green
Pry.config.ls.protected_method_color = :yellow
Pry.config.ls.private_method_color = :gray
# Aliases
Pry.commands.alias_command "wai", "whereami"
Pry.commands.alias_command "e", "edit"
# Default Commands
default_command_set = Pry::CommandSet.new do
command "copy", "Copy argument to the clipboard" do |str|
IO.popen("pbcopy", "w") { |f| f << str.to_s }
end
command "clear" do
system "clear"
output.puts("Rails Environment: " + ENV["RAILS_ENV"]) if ENV["RAILS_ENV"]
end
command "caller_method" do |depth|
depth = depth.to_i || 1
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ caller(depth + 1).first
file = Regexp.last_match[1]
line = Regexp.last_match[2].to_i
method = Regexp.last_match[3]
output.puts [file, line, method]
end
end
end
Pry.config.commands.import default_command_set