Bug #1695: String interpolation Issue with escape characters inside an in-string evaluated statement
http://redmine.ruby-lang.org/issues/show/1695

Author: Jason Pearlman
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.1p129 (2009-05-12 revision 23412) [x86_64-linux]

Apologies if this has already been addressed but I could not find anything:

# Alone, works fine
>> 'a'.gsub("'",'\\\'')
=> "a"
 
# Inside a string in #{} - bombs
>> "hi #{'a'.gsub("'",'\\\'')}"
[just waits for another "]
"
SyntaxError: compile error
(irb):20: unterminated string meets end of file
        from (irb):20


----------------------------------------
http://redmine.ruby-lang.org