Writes yaml to a file in the current working directory or a String from an Object or a String. It uses SnakeYAML as YAML processor. The call will fail if the file already exists.

Fields:

Examples:
Writing to a file:

        def amap = ['something': 'my datas',
                    'size': 3,
                    'isEmpty': false]

        writeYaml file: 'datas.yaml', data: amap
        def read = readYaml file: 'datas.yaml'

        assert read.something == 'my datas'
        assert read.size == 3
        assert read.isEmpty == false
        
Writing to a string:
        def amap = ['something': 'my datas',
                    'size': 3,
                    'isEmpty': false]

        String yml = writeYaml returnText: true, data: amap
        def read = readYaml text: yml

        assert read.something == 'my datas'
        assert read.size == 3
        assert read.isEmpty == false