Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rmpestano committed Jan 29, 2018
1 parent 881136e commit a599a68
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.cukespace.arquillian.asciidoctor;

import com.github.cukespace.arquillian.asciidoctor.api.event.RenderDocsEvent;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.asciidoctor.Asciidoctor;
Expand Down Expand Up @@ -105,6 +106,13 @@ public void stop(@Observes final EventContext<ManagerStopping> ending) {
}
}

public void render(@Observes final RenderDocsEvent renderDocsEvent) {
ArquillianDescriptor descriptor = renderDocsEvent.getDescriptor();
initAsciidoctor(descriptor);
renderAll(descriptor);
}


private void renderAll(final ArquillianDescriptor descriptor) {
for (final ExtensionDef extensionDef : descriptor.getExtensions()) {
if (extensionDef.getExtensionName().startsWith("asciidoctor")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.cukespace.arquillian.asciidoctor.api.event;

import org.jboss.arquillian.config.descriptor.api.ArquillianDescriptor;

import java.io.Serializable;

public class RenderDocsEvent implements Serializable {

private ArquillianDescriptor descriptor;

public RenderDocsEvent(final ArquillianDescriptor descriptor) {
this.descriptor = descriptor;
}

public ArquillianDescriptor getDescriptor() {
return descriptor;
}
}

0 comments on commit a599a68

Please # to comment.