renderPubspecVersion function
Renders a pubspec with its version updated while preserving other content.
Implementation
String renderPubspecVersion(String content, String version) {
final editor = YamlEditor(content)..update(['version'], version);
return editor.toString();
}