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

Fix some file paths break in Windows (#708). file_and_line methods in lib/pry/commands/cat/file_formatter.rb split file path with ':'. So if file path is 'c:/path/to/file', this method works incorrectly. This fix replace ':' to regexp

This commit is contained in:
yui-knk 2013-12-14 20:29:42 +09:00
parent 345641998a
commit 4b284f9aea

View file

@ -22,7 +22,7 @@ class Pry
private
def file_and_line
file_name, line_num = file_with_embedded_line.split(':')
file_name, line_num = file_with_embedded_line.split(/:(?!\/|\\)/)
[file_name, line_num ? line_num.to_i : nil]
end