diff --git a/asciidoctorj-core/src/main/java/org/asciidoctor/internal/JRubyAsciidoctor.java b/asciidoctorj-core/src/main/java/org/asciidoctor/internal/JRubyAsciidoctor.java index b908dadbd..e6947c488 100644 --- a/asciidoctorj-core/src/main/java/org/asciidoctor/internal/JRubyAsciidoctor.java +++ b/asciidoctorj-core/src/main/java/org/asciidoctor/internal/JRubyAsciidoctor.java @@ -26,9 +26,17 @@ import org.jruby.exceptions.RaiseException; import org.jruby.javasupport.JavaEmbedUtils; -import java.io.*; -import java.util.*; -import java.util.logging.Level; +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.logging.Logger; public class JRubyAsciidoctor implements Asciidoctor { @@ -299,16 +307,13 @@ public String render(String content, Map options) { RubyHash rubyHash = RubyHashUtil.convertMapToRubyHashWithSymbols(rubyRuntime, options); - ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader(); try { - Thread.currentThread().setContextClassLoader(rubyRuntime.getJRubyClassLoader()); Object object = this.asciidoctorModule.convert(content, rubyHash); return returnExpectedValue(object); } catch(RaiseException e) { logger.severe(e.getException().getClass().getCanonicalName()); throw new AsciidoctorCoreException(e); } finally { - Thread.currentThread().setContextClassLoader(oldTCCL); // we restore current directory to its original value. rubyRuntime.setCurrentDirectory(currentDirectory); } @@ -332,16 +337,13 @@ public String renderFile(File filename, Map options) { RubyHash rubyHash = RubyHashUtil.convertMapToRubyHashWithSymbols(rubyRuntime, options); - ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader(); try { - Thread.currentThread().setContextClassLoader(rubyRuntime.getJRubyClassLoader()); Object object = this.asciidoctorModule.convertFile(filename.getAbsolutePath(), rubyHash); return returnExpectedValue(object); } catch(RaiseException e) { logger.severe(e.getMessage()); throw new AsciidoctorCoreException(e); } finally { - Thread.currentThread().setContextClassLoader(oldTCCL); // we restore current directory to its original value. rubyRuntime.setCurrentDirectory(currentDirectory); } diff --git a/asciidoctorj-diagram/gradle.properties b/asciidoctorj-diagram/gradle.properties index 402172dfd..b0cf46021 100644 --- a/asciidoctorj-diagram/gradle.properties +++ b/asciidoctorj-diagram/gradle.properties @@ -1,4 +1,4 @@ properName=AsciidoctorJ Diagram description=AsciidoctorJ Diagram bundles the Asciidoctor Diagram RubyGem (asciidoctor-diagram) so it can be loaded into the JVM using JRuby. -version=1.5.5 +version=1.5.4 gem_name=asciidoctor-diagram diff --git a/build.gradle b/build.gradle index 35a867f01..7661a85a4 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ ext { xmlMatchersVersion = '1.0-RC1' // gem versions - asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '1.5.6' + asciidoctorGemVersion = project.hasProperty('asciidoctorGemVersion') ? project.asciidoctorGemVersion : '1.5.6.1' asciidoctorEpub3GemVersion = project(':asciidoctorj-epub3').version.replace('-', '.') asciidoctorDiagramGemVersion = project(':asciidoctorj-diagram').version.replace('-', '.')