2010-12-25 08:59:37 -05:00
|
|
|
class Pry
|
2011-01-19 03:40:43 -05:00
|
|
|
|
2011-04-18 17:31:39 -04:00
|
|
|
|
2011-01-20 20:15:25 -05:00
|
|
|
# The default prompt; includes the target and nesting level
|
2011-01-07 07:18:09 -05:00
|
|
|
DEFAULT_PROMPT = [
|
2011-01-14 06:12:43 -05:00
|
|
|
proc do |target_self, nest_level|
|
2011-02-13 10:49:53 -05:00
|
|
|
|
2011-01-15 03:57:50 -05:00
|
|
|
if nest_level == 0
|
2011-02-13 10:49:53 -05:00
|
|
|
"pry(#{Pry.view_clip(target_self)})> "
|
2010-12-27 07:36:29 -05:00
|
|
|
else
|
2011-02-13 10:49:53 -05:00
|
|
|
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}> "
|
2010-12-27 07:36:29 -05:00
|
|
|
end
|
|
|
|
end,
|
2011-04-18 17:31:39 -04:00
|
|
|
|
2011-01-14 06:12:43 -05:00
|
|
|
proc do |target_self, nest_level|
|
2011-01-15 03:57:50 -05:00
|
|
|
if nest_level == 0
|
2011-02-13 10:49:53 -05:00
|
|
|
"pry(#{Pry.view_clip(target_self)})* "
|
2010-12-27 07:36:29 -05:00
|
|
|
else
|
2011-02-13 10:49:53 -05:00
|
|
|
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}* "
|
2010-12-27 07:36:29 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
]
|
2010-12-27 06:45:47 -05:00
|
|
|
|
2011-01-19 03:40:43 -05:00
|
|
|
# A simple prompt - doesn't display target or nesting level
|
2011-03-02 06:18:26 -05:00
|
|
|
SIMPLE_PROMPT = [proc { ">> " }, proc { ">* " }]
|
2011-04-06 12:59:09 -04:00
|
|
|
|
2011-04-16 05:30:22 -04:00
|
|
|
SHELL_PROMPT = [
|
2011-04-06 23:31:03 -04:00
|
|
|
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} $ " },
|
|
|
|
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} * " }
|
2011-04-06 12:59:09 -04:00
|
|
|
]
|
2010-12-25 08:59:37 -05:00
|
|
|
end
|