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
1 changed files with 1 additions and 1 deletions

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