-
Notifications
You must be signed in to change notification settings - Fork 124
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
AsciidoctorMojo getAsciidoctorInstance updated to check the JRubyRunt… #218
Conversation
…imeContext instance to determine whether either get or get(AsciiDoctor) overloads exist and invoke if the method exists. This ensures we can be compatible with both 1.5.x and 1.6.0 of asciidoctorj
Thanks! Without testing I have two remarks:
Cheers |
thanks @robertpanzer ,
|
Hi Matt, There are no documented standards, just try to align with the rest of the In 2. I meant to have sth like catch (NoSuchMethodException e) { ...} Does this pseudocode make sense to you? Having 5 or 6 catch clauses all doing the same doesn't seem to add any Cheers Am Samstag, 7. Mai 2016 schrieb mattadamson :
|
It's generally better not to catch the very general Exception type however I think we can improve this by using the ReflectiveOperationException type which is a base of most of the types. I also noticed some unchecked types were being caught when eclipse added the clauses. These can safely be removed |
…o reduce catch blocks and also reformat to use spaces for tabs
That's nice, RuntimeExceptions can be removed, yes. Is ReflectiveOperationException already in Java 1.6? Cheers Am Samstag, 7. Mai 2016 schrieb mattadamson :
|
Seems like compilation failed on Java 6 because ReflectiveOperationException is not available. |
…Exception rather than ReflectiveOperationException is used for JDK 1.6 compatibility
thanks it seems I had my JAVA_HOME set to 1.7 so didn't see this on full build. I've changed this to the generic Exception type for now however when we upgrade to 1.7+ I'd prefer we use a multiple type catch clause |
let me know if the current changes are ok and also what I need to do next to merge if happy. |
I trust @robertpanzer with this, I can merge if he sees it perfect.
This happened to us all at some point or another. About the change to 1.7, feel free to open another issue to keep track of this. |
thanks @abelsromero how can I squash all commits though if
|
Hi Matt, I didn’t have the time yet to actually test it, I hope to make it today. If it’s ok, you can simply squash them, across the Asciidoctor projects this is a common practice to squash multiple commits before merging. Cheers
|
When you squash changes git will ask to override the changes using the "force" option, if you are using eclipse it's pretty easy and automatic, it has "squash" option. With IntellJ the process if more manual and tedious using "rebase". Little confesion...I keep an eclipse installation just for this
This PR will be updated with the new commit, the comments and kept, but the reference to the code is lost. But don't worry, this is a normal practice. |
Tested it and it seems to run fine. AsciidoctorJ added support for configuring Extensions via annotations, so that for example block names do not have to be defined by the caller but are already encapsulated in the BlockProcessor, BlockMacroProcessor or InlineMacroProcessor. So should we extend https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/master/src/main/java/org/asciidoctor/maven/extensions/AsciidoctorJExtensionRegistry.java#L57-L64 in a later PR or is it ok for now, @abelsromero To register these processors AsciidoctorJ added new methods |
That's for 1.6 right? asciidoctor/asciidoctorj#343 If that's so, we can open an issue and label for 1.6.0. We already have some https://github.com/asciidoctor/asciidoctor-maven-plugin/milestones/1.6.0 |
Yes, exactly.
That would be nice, yes. |
Then I'm fine to merge. |
@mattadamson if you need help with the squash, let us know. Or if it is easier, you can create a branch and send another PR |
@abelsromero I'd like to learn how to do the squash after it's been pushed in this way. Do you have any links that will help? |
Keep in mind, it's now possible to squash from the Merge button. That saves a lot of headaches for contributors, IMO. |
@mojavelinux really that sounds great? How do I do that? I'm used to using Stash at work and it would be nice if that also had a similar feature |
Perhaps this is what you meant? https://help.github.com/articles/about-pull-request-merge-squashing/ I presume we use this version of github |
That's the one. It can only be done at the time of the merge, so it has to be done by the person merging the PR. As long as the Merge button is green (seen by any person with access), then the changes can be squashed to a single commit at the time the merge is performed. |
@mojavelinux sure let's do that then with a suggestion the original commit message is used to reflect the entire change as only clean up since then |
I was not aware of the new squash feature, the squash option appears after pressing the merge button. |
Exactly. It surprised me the first time too. I've found it to be very useful. It's good when a PR contains multiple commits by a single person. When there are commits from different people, I tend to still use a manual rebase so that each person gets one commit. |
…imeContext instance to determine whether either get or get(AsciiDoctor) overloads exist and invoke if the method exists. This ensures we can be compatible with both 1.5.x and 1.6.0 of asciidoctorj