Skip to content

Instantly share code, notes, and snippets.

@schneems
Created December 25, 2013 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schneems/8127922 to your computer and use it in GitHub Desktop.
Save schneems/8127922 to your computer and use it in GitHub Desktop.

Ruby 2.1.0 YAML regression

# Double quote
require 'YAML'
yaml1 = {"key" => %Q{<%= ENV["PATH"] %>} }.to_yaml
puts yaml1
# Single quote
require 'YAML'
yaml2 = {"key" => %Q{<%= ENV['PATH'] %>} }.to_yaml
puts yaml2

Ruby 2.1.0

Double Quote (note the slash before the quote)

---
key: "<%= ENV[\"PATH\"] %>"

and single quote

---
key: "<%= ENV['PATH'] %>"

Ruby 2.0.0

Double Quote (note no slash)

---
key: <%= ENV["PATH"] %>

Single Quote

---
key: <%= ENV['PATH'] %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment