public List<String> getLoadPaths() { return splitByPathSeparator(this.loadPath); }
private boolean isInPlaceRequired() { return !isOutFileOption() && !isDestinationDirOption() && !isOutputStdout(); }
public static void main(String args[]) { new AsciidoctorInvoker().invoke(args); }
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); } }
@Test public void help_option_should_show_usage_information() { ByteArrayOutputStream output = redirectStdout(); new AsciidoctorInvoker().invoke("--help"); String helpMessage = output.toString(); assertThat(helpMessage, startsWith("Usage: asciidoctor [options] input file")); }
private void setVerboseLevel(JRubyAsciidoctor asciidoctor, AsciidoctorCliOptions asciidoctorCliOptions) { if(asciidoctorCliOptions.isVerbose()) { RubyUtils.setGlobalVariable(asciidoctor.getRubyRuntime(), "VERBOSE", "true"); } else { if(asciidoctorCliOptions.isQuiet()) { RubyUtils.setGlobalVariable(asciidoctor.getRubyRuntime(), "VERBOSE", "nil"); } } }
private boolean isOutputStdout() { return "-".equals(getOutFile()); }
public static void main(String args[]) { // Process .jrubyrc file Main.processDotfile(); new AsciidoctorInvoker().invoke(args); }
private boolean isInPlaceRequired() { return !isOutFileOption() && !isDestinationDirOption() && !isOutputStdout(); }
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); } }
@Test public void no_parameters_should_show_usage_information() { ByteArrayOutputStream output = redirectStdout(); new AsciidoctorInvoker().invoke(); String helpMessage = output.toString(); assertThat(helpMessage, startsWith("Usage: asciidoctor [options] input file")); }
private boolean isOutputStdout() { return "-".equals(getOutFile()); }
public List<String> getClassPaths() { return splitByPathSeparator(this.classPath); }
public static void main(String args[]) { // Process .jrubyrc file Main.processDotfile(); new AsciidoctorInvoker().invoke(args); }
private boolean isInPlaceRequired() { return !isOutFileOption() && !isDestinationDirOption() && !isOutputStdout(); }
private boolean isOutputStdout() { return "-".equals(getOutFile()); }
public List<String> getLoadPaths() { return splitByPathSeparator(this.loadPath); }
@Test(expected=IllegalArgumentException.class) public void no_input_file_should_throw_an_exception() { new AsciidoctorInvoker().invoke(""); }
public List<String> getClassPaths() { return splitByPathSeparator(this.classPath); }
@Test(expected=IllegalArgumentException.class) public void invalid_input_file_should_throw_an_exception() { new AsciidoctorInvoker().invoke("myunknown.adoc"); }