From 0cbbb6206aeeeae9ecabcb0dc3c5737ac346f596 Mon Sep 17 00:00:00 2001 From: Eric Christopherson Date: Tue, 19 Jul 2011 22:20:04 -0500 Subject: [PATCH] fixed attempted modification of frozen string file_name Under MRI 1.9, file_name comes from Method#source_location, which freezes the filename returned. This fix just reassigns file_name to the result of the gsub call, instead of sending gsub!. --- lib/pry/default_commands/introspection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pry/default_commands/introspection.rb b/lib/pry/default_commands/introspection.rb index b9d244b6..583e5c38 100644 --- a/lib/pry/default_commands/introspection.rb +++ b/lib/pry/default_commands/introspection.rb @@ -197,7 +197,7 @@ class Pry end def start_line_syntax_for_editor(file_name, line_number) - file_name.gsub!(/\//, '\\') if RUBY_PLATFORM =~ /mswin|mingw/ + file_name = file_name.gsub(/\//, '\\') if RUBY_PLATFORM =~ /mswin|mingw/ case Pry.editor when /^[gm]?vi/, /^emacs/, /^nano/, /^pico/, /^gedit/, /^kate/