File tree Expand file tree Collapse file tree 3 files changed +15
-21
lines changed
Expand file tree Collapse file tree 3 files changed +15
-21
lines changed Original file line number Diff line number Diff line change 1+ ## [ 1.1.0] - 2020-03-23
2+ * Support for command-line executables provided by the package
3+ * PubspecYaml instances can be created from YAML using string extension method
4+ * This version requires Dart 2.7
5+ * Major refactoring to improve maintainability
6+
17## [ 1.0.0+1] - 2019-12-22
28* README.md correction
39
Original file line number Diff line number Diff line change @@ -20,38 +20,26 @@ The following fields are supported:
2020
2121Other fields are accessible via PubspecYaml.customFields as a JSON structure (Map<String, dynamic>).
2222
23- ## YAML Import / Export
23+ ## YAML Import
2424
25- PubspecYaml provides two methods to serialize pubspec.yaml content:
25+ PubspecYaml provides two methods to import pubspec.yaml content:
2626* The factory method PubspecYaml.loadFromYamlString() creates an object from a string with pubspec.yaml content
27- * PubspecYaml.toYamlString() produces pubspec.yaml content that can be written to a file
27+ * String extension method toPubspecYaml()
2828
29- ## Data Manipulation
30-
31- PubspecYaml uses functional_data extensions to enable equality operations and lenses (https://pub.dev/packages/functional_data ).
29+ ## YAML Export
3230
33- ## Usage
31+ PubspecYaml.toYamlString() produces pubspec.yaml content that can be written to a file
3432
35- To use pubspec_yaml, add the following dependency to pubspec.yaml:
33+ ## Data Manipulation
3634
37- ```
38- dependencies:
39- pubspec_yaml: ^1.0.0
40- ```
35+ PubspecYaml uses functional_data extensions to enable equality operations and lenses (https://pub.dev/packages/functional_data ).
4136
4237## Example
4338
4439The following Dart script checks whether production dependencies have overrides:
4540```
46- import 'dart:io';
47-
48- import 'package:pubspec_yaml/pubspec_yaml.dart';
49-
50- // ignore_for_file: avoid_print
51-
5241void main() {
53- final pubspecYamlContent = File('pubspec.yaml').readAsStringSync();
54- final pubspecYaml = PubspecYaml.loadFromYamlString(pubspecYamlContent);
42+ final pubspecYaml = File('pubspec.yaml').readAsStringSync().toPubspecYaml();
5543
5644 final productionOverrides = pubspecYaml.dependencyOverrides.where(
5745 (override) => pubspecYaml.dependencies.any((
Original file line number Diff line number Diff line change 11name : pubspec_yaml
22description : Dart library to access and manipulate content of pubpec.yaml files
3- version : 1.0.0+1
3+ version : 1.1.0
44homepage : https://github.com/alexei-sintotski/pubspec_yaml
55
66environment :
You can’t perform that action at this time.
0 commit comments