From 4b284f9aead9d04aa2a034329d260b572341ffa7 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sat, 14 Dec 2013 20:29:42 +0900 Subject: [PATCH] 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 --- lib/pry/commands/cat/file_formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pry/commands/cat/file_formatter.rb b/lib/pry/commands/cat/file_formatter.rb index 03226dfb..ec84968a 100644 --- a/lib/pry/commands/cat/file_formatter.rb +++ b/lib/pry/commands/cat/file_formatter.rb @@ -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