That would work, but I think it would confuse people. Which one do I use? Why are there two different option classes? etc. 
—
Sent from Mailbox for iPhone

On Wed, Apr 24, 2013 at 1:45 AM, Alex Soto <notifications@github.com>
wrote:

>> -
>> -        try {
>> -            final InputStream script = getClass().getClassLoader().getResourceAsStream("execute_asciidoctor.rb");
>> -            final InputStreamReader streamReader = new InputStreamReader(script);
>> -            rubyEngine.eval(streamReader, bindings);
>> -        } catch (ScriptException e) {
>> -            getLog().error("Error running ruby script", e);
>> +        final Asciidoctor instance = Asciidoctor.Factory.create();
>> +        final List<File> asciidocFiles = new AsciidocDirectoryWalker(sourceDirectory.getAbsolutePath()).scan();
>> +
>> +        final OptionsBuilder optionsBuilder = OptionsBuilder.options().toDir(outputDirectory).compact(compact)
>> +                .headerFooter(headerFooter).safe(SafeMode.UNSAFE).templateDir(templateDir).templateEngine(templateEngine);
>> +        final AttributesBuilder attributesBuilder = AttributesBuilder.attributes().backend(backend).docType(doctype)
>> +                .imagesDir(imagesDir).sourceHighlighter(sourceHighlighter).title(title);
>> +
>> +        // FIXME: There needs to be a better way to do this -- talk to Alex
> But I have thought another approach, which will not break the compatibility with previous versions, how about create a class called Options which implements Map and it has only gettter/setter, so users can call all of them as usually, but they can use OptionsBuilder too as a DSL to chain all calls: For example:
> ```java
> Options options = new Options();
> options.setCompact(true);
> options.setToDir("...");
> ```
> but also some they can do:
> ```java
> Options options = options().compact(true).toDir("...").get();
> ```
> I think it won't break compatibility and maybe more intuitive?
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/asciidoctor/asciidoctor-maven-plugin/pull/22/files#r3931951