-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incompatibility with AsciidoctorJ 3.0
AsciidoctorJ 3.0 contains a breaking change to the signature of Preprocessor#process. This commit avoids this incompatibility by rewriting the preprocessor extension in Ruby. Fixes gh-949
- Loading branch information
1 parent
690371b
commit 0abc763
Showing
5 changed files
with
35 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
spring-restdocs-asciidoctor/src/main/resources/extensions/default_attributes.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'asciidoctor/extensions' | ||
require 'java' | ||
|
||
class DefaultAttributes < Asciidoctor::Extensions::Preprocessor | ||
|
||
def process(document, reader) | ||
resolver = org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.new() | ||
attributes = document.attributes | ||
attributes["snippets"] = resolver.getSnippetsDirectory(attributes) unless attributes.has_key?("snippets") | ||
false | ||
end | ||
|
||
end | ||
|
67 changes: 0 additions & 67 deletions
67
...est/java/org/springframework/restdocs/asciidoctor/DefaultAttributesPreprocessorTests.java
This file was deleted.
Oops, something went wrong.