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

Re-add (deprecated) Pry#repl for @robgleeson

This commit is contained in:
Conrad Irwin 2012-12-21 22:06:41 -08:00
parent 141f692cfc
commit 00939762c4
2 changed files with 8 additions and 4 deletions

View file

@ -139,6 +139,7 @@ class Pry
# Push a binding for the given object onto the stack.
def push_binding(object)
@stopped = false
binding_stack << Pry.binding_for(object)
end
@ -328,10 +329,10 @@ class Pry
throw(:breakout) if current_binding.nil?
end
# @deprecated
def repl
@@repl_warning ||= (warn "Pry#repl has been replaced by Pry::REPL.start(pry: pry)"; true)
Pry::REPL.start(:pry => self)
# @deprecated - Please use Pry::REPL.start(:pry => pry, :target => target) instead.
def repl(target=binding_stack.last)
@@repl_warning ||= (warn "(deprecation) Pry#repl has been replaced by Pry::REPL.start(:pry => pry)"; true)
Pry::REPL.start(:pry => self, :target => target)
end
def evaluate_ruby(code)

View file

@ -13,6 +13,9 @@ class Pry
def initialize(options)
@pry = options[:pry] || Pry.new(options)
if options[:pry] && options[:target]
@pry.push_binding options[:target]
end
@indent = Pry::Indent.new
end