Skip to content

Commit

Permalink
Everything appears to be working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
LightGuard committed Jan 25, 2013
1 parent 45d325d commit 2861f84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/execute_asciidoctor.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'asciidoctor'

asciidoctor_opts = {:safe => Asciidoctor::SafeMode::UNSAFE, :base_dir => $srcDir}
asciidoctor_opts = {:safe => Asciidoctor::SafeMode::UNSAFE, :base_dir => $srcDir, :backend => $backend}
Dir.new($srcDir).each do |file|
file_ext = File.extname(file.to_s)
if file_ext === '.adoc' or file_ext === '.asciidoc' or file_ext === '.asc' or file_ext === '.ad'
basename = File.basename(file.to_s, file_ext) + ($backend === 'docbook' ? '.xml' : '.html')
doc = Asciidoctor::Document.new(file.lines.to_a, asciidoctor_opts)
File.new($outputDir + '/' + basename, 'w+').puts doc.render
rendered_output = Asciidoctor::Document.new(file.lines.to_a, asciidoctor_opts).render
File.open($outputDir + '/' + basename, 'w') { |f| f.write(rendered_output) }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ class AsciidoctorMojoTest extends Specification {
outputDir.list().toList().contains('sample.xml')

File sampleOutput = new File('sample.xml', outputDir)
sampleOutput.totalSpace > 0
sampleOutput.length() > 0
}
}

0 comments on commit 2861f84

Please sign in to comment.