Skip to content
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

Fixes #249 #250

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 82 additions & 73 deletions aadarchi-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
<name>Aadarchi : Maven plugin</name>
<description>This maven plugin allows integration of our documentation system into maven builds by providing a set of useful mojos</description>
<properties>
<!-- See latest version here: https://mvnrepository.com/artifact/org.asciidoctor/asciidoctorj-diagram -->
<version.asciidoctor.kroki>0.5.0</version.asciidoctor.kroki>
<version.asciidoctor.revealjs>4.1.0</version.asciidoctor.revealjs>
<!-- See latest version here https://mvnrepository.com/artifact/org.jruby/jruby -->
<version.jruby>9.2.9.0</version.jruby>
<!-- See latest version here: https://github.com/hakimel/reveal.js/releases -->
<version.revealjs>4.3.0</version.revealjs>
<gems.destination>${project.build.outputDirectory}/META-INF/gems</gems.destination>
</properties>

<!-- We need the rubygems releases to use Kroki and asciidoc-revealjs
Expand Down Expand Up @@ -84,52 +80,6 @@
</exclusion>
</exclusions>
</dependency>


<!-- asciidoctor-kroki isadded as dependency, but will receive a VERY special treatment -->
<dependency>
<groupId>rubygems</groupId>
<artifactId>asciidoctor-kroki</artifactId>
<version>${version.asciidoctor.kroki}</version>
<type>gem</type>
<!-- Avoid downloading gems included in AsciidoctorJ -->
<exclusions>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>asciidoctor</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>thread_safe</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>concurrent-ruby</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>asciidoctor-revealjs</artifactId>
<version>${version.asciidoctor.revealjs}</version>
<type>gem</type>
<!-- Avoid downloading gems included in AsciidoctorJ -->
<exclusions>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>asciidoctor</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>thread_safe</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>concurrent-ruby</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>

<build>
Expand All @@ -150,28 +100,6 @@
<version>1.0.3</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<jrubyVersion>${version.jruby}</jrubyVersion>
<gemHome>${gems.destination}</gemHome>
<gemPath>${gems.destination}</gemPath>
</configuration>
<executions>
<!-- Install required gems in target directory -->
<execution>
<id>install-gems</id>
<goals>
<goal>initialize</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
Expand Down Expand Up @@ -217,7 +145,88 @@
</plugin>
</plugins>
</build>

</profile>
<profile>
<id>Download rubgems in a scope where I can access that damned repository</id>
<activation>
<file>
<missing>${project.basedir}/src/main/resources/META-INF/gems</missing>
</file>
</activation>
<properties>
<version.asciidoctor.kroki>0.5.0</version.asciidoctor.kroki>
<version.asciidoctor.revealjs>4.1.0</version.asciidoctor.revealjs>
<gems.destination>${project.basedir}/src/main/resources/META-INF/gems</gems.destination>
</properties>
<dependencies>
<!-- asciidoctor-kroki isadded as dependency, but will receive a VERY special treatment -->
<dependency>
<groupId>rubygems</groupId>
<artifactId>asciidoctor-kroki</artifactId>
<version>${version.asciidoctor.kroki}</version>
<type>gem</type>
<!-- Avoid downloading gems included in AsciidoctorJ -->
<exclusions>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>asciidoctor</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>thread_safe</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>concurrent-ruby</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>asciidoctor-revealjs</artifactId>
<version>${version.asciidoctor.revealjs}</version>
<type>gem</type>
<!-- Avoid downloading gems included in AsciidoctorJ -->
<exclusions>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>asciidoctor</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>thread_safe</artifactId>
</exclusion>
<exclusion>
<groupId>rubygems</groupId>
<artifactId>concurrent-ruby</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<jrubyVersion>${version.jruby}</jrubyVersion>
<gemHome>${gems.destination}</gemHome>
<gemPath>${gems.destination}</gemPath>
</configuration>
<executions>
<!-- Install required gems in target directory -->
<execution>
<id>install-gems</id>
<goals>
<goal>initialize</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.
bin
build_info
cache
doc
extensions
gems
specifications
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
..
.
asciidoctor-kroki-0.5.0
asciidoctor-revealjs-4.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
..
.
asciidoctor-kroki.gemspec
Gemfile
Gemfile.lock
lib
Rakefile
spec
tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Style/Encoding:
Enabled: false

Layout/EndOfLine:
EnforcedStyle: lf

Metrics/LineLength:
Max: 180

Metrics/ClassLength:
Max: 150

Metrics/MethodLength:
Max: 50

Metrics/CyclomaticComplexity:
Max: 10

Metrics/PerceivedComplexity:
Max: 10

Metrics/AbcSize:
Max: 30

Metrics/ParameterLists:
Max: 7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
PATH
remote: .
specs:
asciidoctor-kroki (0.5.0)
asciidoctor (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
asciidoctor (2.0.11)
ast (2.4.1)
diff-lcs (1.3)
jaro_winkler (1.5.4)
parallel (1.19.1)
parser (2.7.1.3)
ast (~> 2.4.0)
rainbow (3.0.0)
rake (12.3.3)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.3)
rubocop (0.74.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
unicode-display_width (1.6.1)

PLATFORMS
ruby

DEPENDENCIES
asciidoctor-kroki!
rake (~> 12.3.2)
rspec (~> 3.8.0)
rubocop (~> 0.74.0)

BUNDLED WITH
2.2.17
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Dir.glob('tasks/*.rake').each { |file| load file }

task default: %w[lint spec]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

Gem::Specification.new do |s|
s.name = 'asciidoctor-kroki'
s.version = '0.5.0'
s.summary = 'Asciidoctor extension to convert diagrams to images using Kroki'
s.description = 'An extension for Asciidoctor to convert diagrams to images using https://kroki.io'

s.authors = ['Guillaume Grossetie']
s.email = ['ggrossetie@yuzutech.fr']
s.homepage = 'https://github.com/Mogztter/asciidoctor-kroki'
s.license = 'MIT'
s.metadata = {
'bug_tracker_uri' => 'https://github.com/Mogztter/asciidoctor-kroki/issues',
'source_code_uri' => 'https://github.com/Mogztter/asciidoctor-kroki'
}
s.files = `git ls-files`.split($RS)
s.test_files = s.files.grep(%r{^(test|spec|features|tasks)/})
s.require_paths = ['lib']

s.add_runtime_dependency 'asciidoctor', '~> 2.0'

s.add_development_dependency 'rake', '~> 12.3.2'
s.add_development_dependency 'rspec', '~> 3.8.0'
s.add_development_dependency 'rubocop', '~> 0.74.0'
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
..
.
asciidoctor
asciidoctor-kroki.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# rubocop:disable Naming/FileName
# rubocop:enable Naming/FileName
# frozen_string_literal: true

require_relative 'asciidoctor/extensions/asciidoctor_kroki'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
..
.
extensions
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
..
.
asciidoctor_kroki
asciidoctor_kroki.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
require_relative 'asciidoctor_kroki/extension'

Asciidoctor::Extensions.register do
::AsciidoctorExtensions::Kroki::SUPPORTED_DIAGRAM_NAMES.each do |name|
block_macro ::AsciidoctorExtensions::KrokiBlockMacroProcessor, name
block ::AsciidoctorExtensions::KrokiBlockProcessor, name
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
..
.
extension.rb
Loading