From: Thomas Sawyer Date: 2011-11-07T07:04:39+09:00 Subject: [ruby-core:40799] [ruby-trunk - Feature #5578] Embedded YAML for Ruby 2.0 Issue #5578 has been updated by Thomas Sawyer. YAML defines `...` as end of document marker. data = --- a: 1 b: 2 c: 3 ... <= this Yes, it is something like HERE docs, but more concise. I also have this gut feeling that it could evolve into in even more useful ways in the future, though I can't quite put my finger on it yet. Some interesting "hints" though include: data = eval(source) Where source could be Ruby or YAML. load 'foo.yml' You'd have to use a callback of some sort to get the data, but it's interesting nonetheless that it would work. And I wonder if a "Ruby code escape" could be worked-in, e.g. class A; end foo = "foo" data = --- a: ->{ A } b: ->{ ->{ foo } } c: ->{ 1 + 1 } ... data #=> {'a'=>A, 'b'=>#, 'c'=>2} You get the idea. ---------------------------------------- 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