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