Skip to content

Instantly share code, notes, and snippets.

@utkarshkukreti
Created June 1, 2011 10:11
Show Gist options
  • Save utkarshkukreti/1002072 to your computer and use it in GitHub Desktop.
Save utkarshkukreti/1002072 to your computer and use it in GitHub Desktop.
Single and double quotes in Ripper
pry(Ripper)> sexp %q{"foo\nbar"}
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]]
pry(Ripper)> sexp %q{'foo\nbar'}
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]]
pry(Ripper)> sexp %q{'foo\nbar'}
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]]
pry(Ripper)> sexp %q{'foo\\nbar'}
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]]
pry(Ripper)> sexp %q{"foo\\nbar"}
=> [:program, [[:string_literal, [:string_content, [:@tstring_content, "foo\\nbar", [1, 1]]]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment