asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Ole
Reply | Threaded
Open this post in threaded view
|

asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

Ole
I try to develop a plugin for AsciiDoctor (https://github.com/flowdev/asciidoctor-plugin) but can't get a simple test example to run:

org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass
        at RUBY.registered_for_block?(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/extensions.rb:800)
        at RUBY.next_block(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:675)
        at RUBY.next_section(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:303)
        at RUBY.parse(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:52)
        at RUBY.parse(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:448)
        at RUBY.load(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1337)
        at RUBY.convert(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1415)
        at RUBY.convert(<script>:66)
        at org.jruby.gen.InterfaceImpl438942551.convert(org/jruby/gen/InterfaceImpl438942551.gen:13)

The test class is: https://github.com/flowdev/asciidoctor-plugin/blob/master/src/test/java/org/flowdev/asciidoctorplugin/FlowparserBlockProcessorTest.java

I tried to debug the problem myself in order to see what is 'nil:NilClass'. But the call stack is more than 100 method calls deep of very abstract code. :-(

Please help me. If you need additional information, please just ask.

Best regards

Ole
Reply | Threaded
Open this post in threaded view
|

Re: asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

LightGuardjp
The line that's throwing the exception is at /Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/extensions.rb line 800 or if you want to see it on github: https://github.com/asciidoctor/asciidoctor/blob/v1.5.1/lib/asciidoctor/extensions.rb#L800

If I were to venture a guess just looking at the code, it looks like in your example you may not have a delimiting block. You have the [flowdev] part, but you're missing the actual block delimiters.

On Wed, Nov 5, 2014 at 6:57 AM, Ole [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I try to develop a plugin for AsciiDoctor (https://github.com/flowdev/asciidoctor-plugin) but can't get a simple test example to run:

org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass
        at RUBY.registered_for_block?(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/extensions.rb:800)
        at RUBY.next_block(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:675)
        at RUBY.next_section(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:303)
        at RUBY.parse(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/parser.rb:52)
        at RUBY.parse(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:448)
        at RUBY.load(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1337)
        at RUBY.convert(jar:file:/Users/obulbuk/.m2/repository/org/asciidoctor/asciidoctorj/1.5.1/asciidoctorj-1.5.1.jar!/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1415)
        at RUBY.convert(<script>:66)
        at org.jruby.gen.InterfaceImpl438942551.convert(org/jruby/gen/InterfaceImpl438942551.gen:13)

The test class is: https://github.com/flowdev/asciidoctor-plugin/blob/master/src/test/java/org/flowdev/asciidoctorplugin/FlowparserBlockProcessorTest.java

I tried to debug the problem myself in order to see what is 'nil:NilClass'. But the call stack is more than 100 method calls deep of very abstract code. :-(

Please help me. If you need additional information, please just ask.

Best regards

Ole


To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

mojavelinux
Administrator

On Wed, Nov 5, 2014 at 11:02 AM, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> wrote:
If I were to venture a guess just looking at the code, it looks like in your example you may not have a delimiting block. You have the [flowdev] part, but you're missing the actual block delimiters.

Actually, the problem is that the extension doesn't define any contexts, which is required at the following line:


Here's an example of how you define them:


At the moment there's a bit of a handoff issue between AsciidoctorJ and Asciidoctor that makes this more complicated than necessary. Begin explicit about the :context and :content_model is always safe.

The delimited blocks are always optional...so long as the block is registered on a paragraph.

Ole
Reply | Threaded
Open this post in threaded view
|

Re: asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

Ole
Thanks soooo much! It works much better now.

Is there any documentation of the possible configuration values for "contexts" and "content_model"?
I would need the plugin to run for blocks with delimiters (probably "....").

Ole
Ole
Reply | Threaded
Open this post in threaded view
|

Re: asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

Ole
I am using ":literal" for "contexts" and ":compound" for "content_model" now. This seems to work.
Thanks for your help so far!
Reply | Threaded
Open this post in threaded view
|

Re: asciidoctorj 1.5.1: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `include?' for nil:NilClass

mojavelinux
Administrator
In reply to this post by Ole
Is there any documentation of the possible configuration values for "contexts" and "content_model"? 

This is an open issue. You can find the answer in the comments.


Cheers,

-Dan

On Thu, Nov 6, 2014 at 4:40 AM, Ole [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks soooo much! It works much better now.

Is there any documentation of the possible configuration values for "contexts" and "content_model"?
I would need the plugin to run for blocks with delimiters (probably "....").

Ole


To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--