3 ms·
Ruby on Rails has a databases.yml that is preprocessed by ERB. I often do something like: field: <%= File.read('/foo/bar').to_json %> Though I have myriad
by MyOutfitIsVague 1y ago
Ruby on Rails has a databases.yml that is preprocessed by ERB. I often do something like:
field: <%= File.read('/foo/bar').to_json %>
Though I have myriad criticisms of YAML, this article's arguments are not a concern at all if you can ensure that your YAML parser always uses 1.2 regardless of any %YAML directive.
- 0xbadcafebee 1y agoAs someone who has written a lot of YAML-compatible software, this is my biggest takeaway: every single YAML-parsing tool is incompatible with each other (in some way). If two tools work together, it's an accident. They will work for a while until someone tries to do something with one tool that the other tool doesn't like. If all you do with YAML is serialize data, from one tool, to the exact same tool, it's fine. For all other purposes you should seek a different data format (if you don't want to deal with the eventual bugs). (note that I don't mean parser/library, I mean tool. the tool using the library will often use or not-use certain options which increases the complexity of the interactions and leads to more possible failures)