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

improved breaking up file:line syntax to take care of windows c:/blah.rb:10 edgecase

This commit is contained in:
John Mair 2011-09-07 20:58:58 +12:00
parent d209414ed9
commit 95cd5f4724

View file

@ -151,7 +151,11 @@ class Pry
line = eval_string.lines.count + 1
should_reload_locally = opts[:n] ? false : true
else
file_name, line = File.expand_path(args.first).split(/:/)
# break up into file:line
/(:(\d+))?$/ =~ File.expand_path(args.first)
# $` is pre-match
file_name, line = [$`, $2]
line = line ? line.to_i : opts[:l].to_i
end