{"comment":{"created_at":"2011-10-18T20:24:35Z","body":"OK I pushed a fix for that","updated_at":"2011-10-18T20:24:35Z","url":"https://api.github.com/repos/ripienaar/hiera/issues/comments/2447239","id":2447239,"user":{"gravatar_id":"9482a1c5a9c64c5d7296971f030165b7","avatar_url":"https://secure.gravatar.com/avatar/9482a1c5a9c64c5d7296971f030165b7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/ripienaar","id":82342,"login":"ripienaar"}},"action":"created","issue":{"number":22,"created_at":"2011-10-18T00:33:45Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Current we have an array of hashs in our yaml file\r\n\r\n```yaml\r\npeople:\r\n- name: \"Trevor\"\r\n  id: \"101\"\r\n- name: \"Tim\"\r\n  id: \"202\"\r\n```\r\n\r\nUsing thearray option with hiera it tries to flatten, uniq, compact and sort the data. I believe it goes fine until the sort.\r\n\r\n> ./lib/hiera/backend.rb:132:in `sort': undefined method `<=>' for {\"name\"=>\"Trevor\", \"id\"=>\"101\"}:Hash (NoMethodError)\r\n        from ./lib/hiera/backend.rb:132:in `resolve_answer'\r\n        from ./lib/hiera/backend.rb:166:in `lookup'\r\n        from ./lib/hiera.rb:59:in `lookup'\r\n        from bin/hiera:208\r\n\r\nI am not sure of the best approach for a fix.  I am using ruby 1.8.5.  I heard ruby < 1.9 don't support sorting hashs.  Using ruby 1.9.2 with hiera seems to have it's own issues though (https://github.com/ripienaar/hiera/issues/19)  . \r\n\r\nThoughts?","comments":5,"title":"Proper handling of array hashs","updated_at":"2011-10-18T20:24:35Z","url":"https://api.github.com/repos/ripienaar/hiera/issues/22","id":1935150,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"044209a5d0fcd912b2f42ccc7e5e0545","avatar_url":"https://secure.gravatar.com/avatar/044209a5d0fcd912b2f42ccc7e5e0545?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/CatDaaaady","id":1120955,"login":"CatDaaaady"},"html_url":"https://github.com/ripienaar/hiera/issues/22","labels":[],"state":"open"},"legacy":{"issue_id":1935150,"comment_id":2447239}}