asciidoctor/asciidoctor-gradle-plugin — pull request #121 by ysb33r (2014-09-08 13:21:01+00:00)
Title: Addressing #120 (Suggestions for refactoring)

As per #120 I have reworked a number of properties. Before discussing them, note that I have left the following alone:

+ `logDocuments` - I see no reason for messing with this
+ `baseDir` - Not sure yet where we want to go with this. If it needs to follow suit with the others then it should be a simple refactor for anyone. Just follow the way `outputDir` was.
+ `classpath` - Specialist use, might just be best left as a property.
+ `asciidoctorProxy` - It's only use is probably only for testing. We could consider making it private actually and annotaing it with `@PackageScope`. However that is outside the scope of this refactoring.

The following were refactored:

+ `sourceDir` - Can do `sourceDir path`, `setSourceDir path` or `sourceDir=path`. I have left the door open to be easily acommodate #108.
+ `outputDir` - Can do `outputDir path`, 'setOutputDir path` or `outputDir=path`.
+ `requires` - Now has the ability to be called for than once. Dropped the need for `[]` unless you want to do `requires=['gemname']`. Can also do `setRequires`.
+ `backends` - Pretty much like `requires`.+ `gemPath`- Can be called more than once to append paths. Can do `gemPath`, `setGemPath` and `gemPath=`. Will accept a platform-specific delimited string of GEM paths for backwards compatibility if called via the assignment form of `gemPath='path1:path2'`.
+ `options` - Can be called more that once and will append. Also allows `setOptions` and `options=[:]` fomrats which will overwrite.
+ `attributes` - Pulled out attributes from options so that it can also be called more than once. For backwards compatibility, `attributes` can still be embedded within options and will be extracted accordingly during configuration time. A warning will be printed if embedded attribtues are found. If embedded the use of a list and string will still be allowed, but the newer form does not allow this as the use of repeatable calls to `attributes` is a more convenient solution.

Example of bew form of `options` and `attributes`.

```groovy
options doctype: 'book', ruby: 'erubis'

attributes 'source-highlighter': 'coderay',
toc : '',
idprefix : '',
idseparator : '-'
```

The README has also been updated so show these changes. I think we can probably improve the layout, but this is good enough for this commit.

A number of unit tests have been added to cover these changes. They should give us pretty good coverage.
I am still going to do some manual testing with this in some of my downstream usages, just to see how well it works. However, I think it is good enough for a review at this point in time, probably for a merge too.