Skip to content

Commit

Permalink
Updating documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualdogbert committed Apr 7, 2019
1 parent 631c18c commit 0cda7e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
15 changes: 11 additions & 4 deletions src/docs/gettingStarted.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@

1. Add the following dependency:
.build.gradle
+
----
compile 'com.virtualdogbert:GroovyConfigWriter:1.0'
compile 'com.virtualdogbert:GroovyConfigWriter:1.1'
----
2. Some sample code
1. Parameters
* fileName - Optional file name to write the output to. By default is not specified the output will be written to System.out.
* config - An Optional parameter to pass in config to be written. You can also directly call the writeToGroovy, which could be useful for writing in multiple chunks. This might be useful if your config comes from a yml file, which has multiple documents.
* indentSpacer - Optional parameter the spacer to be used for indenting, by default four spaces is used.
* quoteValues - values that will be quoted.
* asClosure - true by default using the closure syntax, vs the map based syntax for the groovy config.
1. Some sample code:
+
[source,groovy]
----
@Grab('com.virtualdogbert:GroovyConfigWriter:1.0')
@Grab('com.virtualdogbert:GroovyConfigWriter:1.1')
@Grab('org.yaml:snakeyaml:1.18')
@Grab('org.slf4j:slf4j-api:1.7.25')
@Grab('ch.qos.logback:logback-classic:0.9.28')
Expand Down
2 changes: 1 addition & 1 deletion src/docs/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ https://www.youtube.com/watch?v=aro3_RZqgtU
I wrote this to be used in a script to provide a conversion from yml to groovy, which I though there
should be, because I find the groovy format to be more flexible, and readable, then yml. I found it
Strange when Graeme Rocher said:
"But to answer the question more concretely we wanted a format that is machine writeable as well as readable"
"But to answer the question more concretely we wanted a format that is machine writable as well as readable"
- https://www.youtube.com/watch?v=aro3_RZqgtU

Surely since there is a Config Slurper, there has to be a config writer right? Well I was wrong, partially...
Expand Down
11 changes: 11 additions & 0 deletions src/docs/versionHistory.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
== Version History
* 1.1
** Fixed and issue where yml key names that have dashes in them show up like this:
+
[source,groovy]
```
template {
template['check-template-location'] = false
}
```
** Updated unit tests.
** Updated documentation.
* 1.0
** People have been using it for quite a while with no major complaints, so it's time to kick it to 1.0 with some updates
** Added in a asClosure option, which defaults to true, however, it you change it to false you will get a map based output instead.
Expand Down

0 comments on commit 0cda7e2

Please sign in to comment.