Let pry_eval take a target as the first param

This commit is contained in:
Ryan Fitzgerald 2012-08-19 12:39:54 -07:00
parent f4c3ada10a
commit e28bf4149c
1 changed files with 7 additions and 1 deletions

View File

@ -208,7 +208,13 @@ def pry_tester(context = TOPLEVEL_BINDING, &block)
end
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
class PryTester