mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Use _pry_.config in prompts
This commit is contained in:
parent
29544057e7
commit
c8464056ca
1 changed files with 8 additions and 8 deletions
16
lib/pry.rb
16
lib/pry.rb
|
@ -70,20 +70,20 @@ class Pry
|
|||
NO_PROMPT = [proc { '' }, proc { '' }]
|
||||
|
||||
SHELL_PROMPT = [
|
||||
proc { |target_self, _, _| "#{Pry.config.prompt_name} #{Pry.view_clip(target_self)}:#{Dir.pwd} $ " },
|
||||
proc { |target_self, _, _| "#{Pry.config.prompt_name} #{Pry.view_clip(target_self)}:#{Dir.pwd} * " }
|
||||
proc { |target_self, _, _pry_| "#{_pry_.config.prompt_name} #{Pry.view_clip(target_self)}:#{Dir.pwd} $ " },
|
||||
proc { |target_self, _, _pry_| "#{_pry_.config.prompt_name} #{Pry.view_clip(target_self)}:#{Dir.pwd} * " }
|
||||
]
|
||||
|
||||
# A prompt that includes the full object path as well as
|
||||
# input/output (_in_ and _out_) information. Good for navigation.
|
||||
NAV_PROMPT = [
|
||||
proc do |conf|
|
||||
tree = conf.binding_stack.map { |b| Pry.view_clip(b.eval("self")) }.join " / "
|
||||
"[#{conf.expr_number}] (#{Pry.config.prompt_name}) #{tree}: #{conf.nesting_level}> "
|
||||
proc do |_, _, _pry_|
|
||||
tree = _pry_.binding_stack.map { |b| Pry.view_clip(b.eval("self")) }.join " / "
|
||||
"[#{_pry_.input_array.count}] (#{_pry_.config.prompt_name}) #{tree}: #{_pry_.binding_stack.size - 1}> "
|
||||
end,
|
||||
proc do |conf|
|
||||
tree = conf.binding_stack.map { |b| Pry.view_clip(b.eval("self")) }.join " / "
|
||||
"[#{conf.expr_number}] (#{ Pry.config.prompt_name}) #{tree}: #{conf.nesting_level}* "
|
||||
proc do |_, _, _pry_|
|
||||
tree = _pry_.binding_stack.map { |b| Pry.view_clip(b.eval("self")) }.join " / "
|
||||
"[#{_pry_.input_array.count}] (#{ _pry_.config.prompt_name}) #{tree}: #{_pry_.binding_stack.size - 1}* "
|
||||
end,
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue