1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/lib/pry/prompts.rb

32 lines
1.1 KiB
Ruby
Raw Normal View History

class Pry
2011-04-18 17:31:39 -04:00
# The default prompt; includes the target and nesting level
DEFAULT_PROMPT = [
proc do |target_self, nest_level|
if nest_level == 0
"pry(#{Pry.view_clip(target_self)})> "
else
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}> "
end
end,
2011-04-18 17:31:39 -04:00
proc do |target_self, nest_level|
if nest_level == 0
"pry(#{Pry.view_clip(target_self)})* "
else
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}* "
end
end
]
# A simple prompt - doesn't display target or nesting level
SIMPLE_PROMPT = [proc { ">> " }, proc { ">* " }]
SHELL_PROMPT = [
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} $ " },
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} * " }
]
end