private JRubyAsciidoctor buildAsciidoctorJInstance(AsciidoctorCliOptions asciidoctorCliOptions) { ClassLoader oldTccl = Thread.currentThread().getContextClassLoader(); try { if (asciidoctorCliOptions.isClassPaths()) { URLClassLoader tccl = createUrlClassLoader(asciidoctorCliOptions.getClassPaths()); Thread.currentThread().setContextClassLoader(tccl); } JRubyAsciidoctor asciidoctor; if (asciidoctorCliOptions.isLoadPaths()) { asciidoctor = JRubyAsciidoctor.create(asciidoctorCliOptions.getLoadPaths()); } else { asciidoctor = JRubyAsciidoctor.create((String) null); } return asciidoctor; } finally { Thread.currentThread().setContextClassLoader(oldTccl); } }
private JRubyAsciidoctor buildAsciidoctorJInstance(AsciidoctorCliOptions asciidoctorCliOptions) { ClassLoader oldTccl = Thread.currentThread().getContextClassLoader(); try { if (asciidoctorCliOptions.isClassPaths()) { URLClassLoader tccl = createUrlClassLoader(asciidoctorCliOptions.getClassPaths()); Thread.currentThread().setContextClassLoader(tccl); } JRubyAsciidoctor asciidoctor; if (asciidoctorCliOptions.isLoadPaths()) { asciidoctor = JRubyAsciidoctor.create(asciidoctorCliOptions.getLoadPaths()); } else { asciidoctor = JRubyAsciidoctor.create((String) null); } return asciidoctor; } finally { Thread.currentThread().setContextClassLoader(oldTccl); } }