improved breaking up file:line syntax to take care of windows c:/blah.rb:10 edgecase
This commit is contained in:
parent
d209414ed9
commit
95cd5f4724
|
@ -151,7 +151,11 @@ class Pry
|
||||||
line = eval_string.lines.count + 1
|
line = eval_string.lines.count + 1
|
||||||
should_reload_locally = opts[:n] ? false : true
|
should_reload_locally = opts[:n] ? false : true
|
||||||
else
|
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
|
line = line ? line.to_i : opts[:l].to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue