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

allow Pry::Command.source to properly extract source for commands defined in REPL

This commit is contained in:
John Mair 2012-12-20 20:14:11 +01:00
parent 3f7448ed4c
commit d1222396e3

View file

@ -55,7 +55,8 @@ class Pry
end
def source
strip_leading_whitespace(block.source)
file, line = block.source_location
strip_leading_whitespace(Pry::Code.from_file(file).expression_at(line))
end
def source_location