#595: our YAML library does not honor #add_builtin_type -----------------------------------+---------------------------------------- Reporter: lsansone...@… | Owner: neerac...@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- rails 3 uses the following code that does not work on macruby because the add_builtin_type method is not implemented:
{{{ class OrderedHash #:nodoc: def to_yaml_type "!tag:yaml.org,2002:omap" end def to_yaml(opts = {}) YAML.quick_emit(self, opts) do |out| out.seq(taguri, to_yaml_style) do |seq| each do |k, v| seq.add(k => v) end end end end end YAML.add_builtin_type("omap") do |type, val| ActiveSupport::OrderedHash[val.map(&:to_a).map(&:first)] end }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/595> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel