Closed jasnow closed 1 year ago
There isn't an easy way to parse and preserve the additional YAML comments. That would require using YAML.parse
which returns a raw node tree of the YAML data, which is much harder to work with, merging in the new data and dumping the YAML nodes back out to the file.
An alternative approach would be to use an ERB template to render the advisory file, and properly format all YAML data. It might also be a good idea to create a separate Advisory
class which represents the contents of the YAML file that could be used for loading the data and rendering the output. This might also require pulling in additional libraries to handle word-wrapping.
If additional items come up in the future, we can open new issues/PRs for them.
Automate patched_versions conversion from GHSA to ruby-advisory-db.