Skip to content

Instantly share code, notes, and snippets.

@crash2burn
Created June 26, 2009 14:36
Show Gist options
  • Save crash2burn/136535 to your computer and use it in GitHub Desktop.
Save crash2burn/136535 to your computer and use it in GitHub Desktop.
# Ruby bug or is it part of the "rules" that you cannot do this:
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment