mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Let pry_eval take a target as the first param
This commit is contained in:
parent
f4c3ada10a
commit
e28bf4149c
1 changed files with 7 additions and 1 deletions
|
@ -208,7 +208,13 @@ def pry_tester(context = TOPLEVEL_BINDING, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pry_eval(*eval_strs)
|
def pry_eval(*eval_strs)
|
||||||
pry_tester.eval(*eval_strs)
|
if eval_strs.first.is_a? String
|
||||||
|
binding = TOPLEVEL_BINDING
|
||||||
|
else
|
||||||
|
binding = Pry.binding_for(eval_strs.shift)
|
||||||
|
end
|
||||||
|
|
||||||
|
pry_tester(binding).eval(*eval_strs)
|
||||||
end
|
end
|
||||||
|
|
||||||
class PryTester
|
class PryTester
|
||||||
|
|
Loading…
Reference in a new issue