New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple small changes #509

Merged
merged 12 commits into from Sep 9, 2016

Conversation

Projects
None yet
2 participants
@kduske-n4

kduske-n4 commented Sep 6, 2016

Sorry to submit multiple changes in one pull request (and not using branches), but I had to make these changes in quick succession and could not isolate them. They are independent of each other, however. There are three changes:

Convert nested Java maps to Ruby hashes in RubyHashUtil#toRubyObject
This prevents a ClassCastException when, after creating a new block in a block processor, you attempt to access the attributes of that block later in a tree processor. When asking the block for its attributes, AsciidoctorJ assumes that what it gets from the asciidoctor AST is an instance of RubyHash, when in this case what it really gets is an instance of MapJavaProxy that was injected by JRuby into the asciidoctor AST when the block was created originally.

I'm not sure about this change, since I had to choose one of several different methods to convert Java maps to Ruby hashes in RubyHashUtil.

Return null if the inner document of a table cell is nil
This prevents a NullPointerException when attempting to access the inner document of a table cell in a processor when that cell doesn't have an inner document in the asciidoctor AST.

Add getter for @content_model
This adds a getter for the @content_model attribute of an asciidoctor AbstractBlock to StructuralNode.

I hope these changes are useful for you and that you can apply them. I have run the tests in the asciidoctorj-asciidoctorj and asciidoctorj-distribution projects and there were no failures.

@robertpanzer

This comment has been minimized.

Show comment
Hide comment
@robertpanzer

robertpanzer Sep 8, 2016

Member

Thanks a lot for your great contribution, Kristian!

Would you mind adding tests for the three problems you fixed?
That should be

That would help us a lot and would avoid that we later stumble over these problems again.

Member

robertpanzer commented Sep 8, 2016

Thanks a lot for your great contribution, Kristian!

Would you mind adding tests for the three problems you fixed?
That should be

That would help us a lot and would avoid that we later stumble over these problems again.

@kduske-n4

This comment has been minimized.

Show comment
Hide comment
@kduske-n4

kduske-n4 Sep 8, 2016

Added test cases as requested.

kduske-n4 commented Sep 8, 2016

Added test cases as requested.

@robertpanzer

This comment has been minimized.

Show comment
Hide comment
@robertpanzer

robertpanzer Sep 9, 2016

Member

Thanks a lot! Such tests really help us.
Executed them locally and they look good, if I revert the main code, I can also see the errors that you fixed.

There are a couple of code style problems that codenarc complains.
Would you mind fixing them?
While it might seem pedantic it helps us to keep a common code style across the groovy code.
When doing a ./gradlew clean build codenarc will create a report that shows you what it doesn't like.

Thanks a lot!

Cheers
Robert

Member

robertpanzer commented Sep 9, 2016

Thanks a lot! Such tests really help us.
Executed them locally and they look good, if I revert the main code, I can also see the errors that you fixed.

There are a couple of code style problems that codenarc complains.
Would you mind fixing them?
While it might seem pedantic it helps us to keep a common code style across the groovy code.
When doing a ./gradlew clean build codenarc will create a report that shows you what it doesn't like.

Thanks a lot!

Cheers
Robert

@kduske-n4

This comment has been minimized.

Show comment
Hide comment
@kduske-n4

kduske-n4 Sep 9, 2016

Sure, will do!

kduske-n4 commented Sep 9, 2016

Sure, will do!

@kduske-n4

This comment has been minimized.

Show comment
Hide comment
@kduske-n4

kduske-n4 commented Sep 9, 2016

Done ;-)

@kduske-n4

This comment has been minimized.

Show comment
Hide comment
@kduske-n4

kduske-n4 Sep 9, 2016

Some things still seem broken in your CI. I have run the tests locally and it was fine. Any hints?

kduske-n4 commented Sep 9, 2016

Some things still seem broken in your CI. I have run the tests locally and it was fine. Any hints?

@robertpanzer robertpanzer merged commit 543ad9d into asciidoctor:asciidoctorj-1.6.0 Sep 9, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@robertpanzer

This comment has been minimized.

Show comment
Hide comment
@robertpanzer

robertpanzer Sep 9, 2016

Member

Yes, there are some problems with Asciidoctor PDF and JRuby on Windows.
That's why this test is in. :-)
Will upgrade the JRuby version soon and look if it works better now (even though I don't have much hope)
Unix build is green, so I'm fine to merge.

Thanks!

Member

robertpanzer commented Sep 9, 2016

Yes, there are some problems with Asciidoctor PDF and JRuby on Windows.
That's why this test is in. :-)
Will upgrade the JRuby version soon and look if it works better now (even though I don't have much hope)
Unix build is green, so I'm fine to merge.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment