scripts: add version mapping automation v2
Adds lib/version_mapping.rb
Built around treating the file as an array of strings, finding the version mapping table by known header, and then replacing the content after updating & sorting in memory.
Process:
- load
version_mappings.md
into VersionMapping::Document - locate and parse the table from document into VersionMapping::Table
- append to the table, where a matching chart Version will overwrite an existing entry by the same version
- write back to
version_mappings.md
, automatically sorting table
vm = VersionMapping.new(filepath) # will instantiate Document
vm.insert_version(chart_version,app_version) # insert / update versions
vm.finalize #perform write
Missing:
- RSpec (#1193)
Closes #999 (closed)
Edited by Jason Plum