From notifications-return-13982-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sun Sep 16 03:40:13 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B90B3180629 for ; Sun, 16 Sep 2018 03:40:12 +0200 (CEST) Received: (qmail 36042 invoked by uid 500); 16 Sep 2018 01:40:11 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 36033 invoked by uid 99); 16 Sep 2018 01:40:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Sep 2018 01:40:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BF6FBE0181; Sun, 16 Sep 2018 01:40:11 +0000 (UTC) From: paulk-asert To: notifications@groovy.apache.org Reply-To: notifications@groovy.apache.org References: In-Reply-To: Subject: [GitHub] groovy pull request #797: GROOVY-8794: Add groovy-yaml subproject to support... Content-Type: text/plain Message-Id: <20180916014011.BF6FBE0181@git1-us-west.apache.org> Date: Sun, 16 Sep 2018 01:40:11 +0000 (UTC) Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/797#discussion_r217899699 --- Diff: subprojects/groovy-yaml/src/spec/doc/yaml-userguide.adoc --- @@ -0,0 +1,112 @@ +////////////////////////////////////////// + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +////////////////////////////////////////// + += Processing YAML + +Groovy comes with integrated support for converting between Groovy objects and YAML. The classes dedicated to +YAML serialisation and parsing are found in the `groovy.yaml` package. + +[[yaml_yamlslurper]] +== YamlSlurper + +`YamlSlurper` is a class that parses YAML text or reader content into Groovy data structures (objects) such as maps, lists and +primitive types like `Integer`, `Double`, `Boolean` and `String`. + +The class comes with a bunch of overloaded `parse` methods plus some special methods such as `parseText` +and others. For the next example we will use the `parseText` method. It parses a YAML `String` and recursively converts it to a +list or map of objects. The other `parse*` methods are similar in that they return a YAML `String` but for different parameter +types. + +[source,groovy] +---- +include::{rootProjectDir}/subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy --- End diff -- I'd just bring in lines 24-47 ---