From: d c Date: 2007-08-02T14:56:18+09:00 Subject: ordered hashes/ yaml? ------=_Part_158_15246461.1186034180765 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline hi - i understand hashes dont keep their order in ruby, so wondering what the most elegant way to create some YAML that i want to maintain order is... for a simple menu system, i have a YAML file currently as: section1: link1: home link2: my page link3: logout section2: ... etc but after reading in thru YAML::load this can come out as a different order. eg the logout button first... but to keep this as an array, it seems nasty to step thru and read pairs/skip in twos thru the array: section: { link1, home, link2, mypage ... } on the subject, what do people like as a clear examples site? the spec does its best to make YAML as unreadable as XML... http://yaml.org/spec/current.html#id2540046 http://yaml4r.sourceforge.net/cookbook/ seems good thanks! /dc ------=_Part_158_15246461.1186034180765--