Class AsciidoctorJRuby.Factory

java.lang.Object
org.asciidoctor.jruby.AsciidoctorJRuby.Factory
Enclosing interface:
AsciidoctorJRuby

public static final class AsciidoctorJRuby.Factory extends Object
Factory for creating a new instance of Asciidoctor interface.
  • Method Details

    • create

      public static AsciidoctorJRuby create()
      Creates a new instance of Asciidoctor.
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor Ruby calls.
    • create

      public static AsciidoctorJRuby create(String gemPath)
      Creates a new instance of Asciidoctor and sets GEM_PATH environment variable to provided gemPath. This method is mostly used in OSGi environments.
      Parameters:
      gemPath - where gems are located.
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor Ruby calls.
    • create

      public static AsciidoctorJRuby create(List<String> loadPaths)
      Creates a new instance of Asciidoctor and sets loadPath to provided paths. This method is mostly used in OSGi environments.
      Parameters:
      loadPaths - where Ruby libraries are located.
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor Ruby calls.
    • create

      public static AsciidoctorJRuby create(ClassLoader classloader)
      Creates a new instance of Asciidoctor and sets a specific classloader for the JRuby runtime to use. This method is for use in environments like OSGi. To initialize Asciidoctor in OSGi create the Asciidoctor instance like this:
       org.jruby.javasupport.JavaEmbedUtils.initialize(Arrays.asList("uri:classloader:/gems/asciidoctor-1.5.8/lib"));
       Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader());
       
      Parameters:
      classloader -
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor Ruby calls.
    • create

      public static AsciidoctorJRuby create(ClassLoader classloader, String gemPath)
      Creates a new instance of Asciidoctor and sets a specific classloader and gempath for the JRuby runtime to use. This method is for use in environments like OSGi. To initialize Asciidoctor in OSGi create the Asciidoctor instance like this:
       org.jruby.javasupport.JavaEmbedUtils.initialize(Arrays.asList("uri:classloader:/gems/asciidoctor-1.5.8/lib"));
       Asciidoctor asciidoctor = Asciidoctor.Factory.create(this.getClass().getClassLoader());
       
      Parameters:
      classloader -
      gemPath -
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor
    • create

      public static AsciidoctorJRuby create(List<String> loadPaths, String gemPath)
      Creates a new instance of Asciidoctor and sets loadPath to provided paths. The gem path of the Ruby instance is set to the gemPath parameter.
      Parameters:
      loadPaths - where Ruby libraries are located.
      gemPath - where gems are located.
      Returns:
      Asciidoctor instance which uses JRuby to wraps Asciidoctor Ruby calls.