![]() Writing to a file: def amap = ['something': 'my datas', It is required that either file is provided, or returnText is true. returnText (optional): Return the JSON as a string instead of writing it to a file.pretty (optional): Prettify the output with this number of spaces added to each level of indentation.If provided, then returnText must be false or omitted. file (optional): Optional path to a file in the workspace to write to.Can either be a JSON instance or another Map/List implementation. Write JSON to a file in the current working directory, or to a String. With file dir/my.yml containing something: 'my datas' : def datas = readYaml file: 'dir/my.yml', text: "something: 'Override'" With several YAML documents : def datas = readYaml text: """Īssert datas.something = 'my first document'Īssert datas.something = 'my second document' With only one YAML document : def datas = readYaml text: """ ![]() These are added to the resulting object after file and so will overwrite any value already present if not a new YAML document
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |