Help understanfing tag resolution confusion
Trans <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
HI, I've been work with the Pysch library which is the YAML library that
Ruby uses built upon libyaml.
Psych provides a away to add domain tag. Below I add a tag with `foo.org`
domain and `foo` name,
it creates a tag from that called `tag:foo.org:foo`. It also creates a tag
called `tag:foo`.
(See https://github.com/tenderlove/psych/blob/master/lib/psych.rb#L304-L308)
require 'yaml'
YAML.add_domain_type('foo.org', 'foo'){ |*a| "frak" }
["tag:foo.org:foo", #<Proc:0x00000000eec280@(irb):2>]
But then I can use all the following tags in the YAML to reolve to this
domain tag:
YAML.load('--- !<tag:foo.org:foo> "a"')
=> "frak"
YAML.load('--- !<tag:foo> "a"')
=> "frak"
YAML.load('--- !tag:foo.org:foo "a"')
=> "frak"
YAML.load('--- !tag:foo "a"')
=> "frak"
YAML.load('--- !foo.org:foo "a"')
=> "frak"
YAML.load('--- !foo "a"')
=> "frak"
Are all of these tags actually valid and resolvable to `tag:foo.org:foo` of
`tag:foo` ?
It seems like the `tag:` is meaningless and can match if it is there or if
it is not there.
Is that right? Or is this non-spec behaviour on Psych's part?
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core