Issue #5578 has been updated by Kurt  Stephens.


Why does YAML need first class status?  Define a constructor on the YAML module, and use interpolating heredoc.

require 'pp'
require 'yaml'
def YAML.[]str; YAML.load(str); end

x = YAML[<<"..."]
a: 1
b: 2
c: #{ 1 + 1 }
...

pp x

And it's generic enough for other encodings:

xml = XML[<<"end"]
<some><xml><dom><containing>text</containing></dom></xml></some>
end

etc.

----------------------------------------
Feature #5578: Embedded YAML for Ruby 2.0
http://redmine.ruby-lang.org/issues/5578

Author: Thomas Sawyer
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 2.0.0


Way cool would be support for embedded YAML.

  data = ---
         a: 1
         b: 2
         c: 3
         ...




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