Skip to content

Commit

Permalink
Bumped Asciidoctor to 1.5.6.1 and removed setting TCCL again.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpanzer committed Jul 29, 2017
1 parent 62cce55 commit 450dbd6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -299,16 +307,13 @@ public String render(String content, Map<String, Object> 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);
}
Expand All @@ -332,16 +337,13 @@ public String renderFile(File filename, Map<String, Object> 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);
}
Expand Down
2 changes: 1 addition & 1 deletion asciidoctorj-diagram/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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('-', '.')
Expand Down

0 comments on commit 450dbd6

Please sign in to comment.