asciidoctor-diagram 2.2.17 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23e0718c877d72f84af027588bb5a9d100dda3568b34e89655f26c7cf7a4eb07
4
- data.tar.gz: a4ecd6791f531cb9654651ae982e7e52406a462075814a78106188729388f45e
3
+ metadata.gz: ba1fe3f7c564342dde9942ddb021de41fd84e10d2661b0fe29f8e716c960e145
4
+ data.tar.gz: 5b504adb1364e2c7a709adebebe54b68af6e5571de5192f3784567178839c24a
5
5
  SHA512:
6
- metadata.gz: 5982bee6e194b651cac1b55af22fb0cc7ccc51341e952f08f70c978efbf2a58d1392f2095607e574ab3078bc4c3b4c9b2424f75c0420f2bad7f8e033c45b52ee
7
- data.tar.gz: 402707bbd842e2ec8fcf3da65ee60287d08dcbb0f5b0610313ca05985899c03d06a1199aab25632b06239df57d83408f7be73b53981653aaaa49c4f4884df4b8
6
+ metadata.gz: cd0ce65811837cd0ee3be1b00eb1e3fe8a951f3b4f0e8c94846450489adc8692d80eab616d1a653fc8bfc8444e92b345e9cb79acac007f5ef49e1fae99108553
7
+ data.tar.gz: 2289407dc63908392cdcd9bd3e4980b7ec95dd0f2e0ed38f493ea243d62c2f3fa68fff8128b4a3ef7a7dbbc7e46822696551e70b1ef4230f2bf9a7f130a37d49
data/CHANGELOG.adoc CHANGED
@@ -1,5 +1,28 @@
1
1
  = Asciidoctor-diagram Changelog
2
2
 
3
+ == 2.3.1
4
+
5
+ Enhancements::
6
+
7
+ * Issue #423: Add support for loading JSyntrax via the `asciidoctor-diagram-jsyntrax` gem (@inponomarev)
8
+ * Issue #464: Remove usage of 'base64' gem to resolve Ruby 3.3+ compatibility issues
9
+
10
+ Bugfixes::
11
+
12
+ * Issue #459: Fix lookup of `wavedrom-cli` location on Windows
13
+
14
+ == 2.3.0
15
+
16
+ Enhancements::
17
+
18
+ * Issue #457: Relaxed Java version requirement from 11 to 1.8 (for tools that support it)
19
+
20
+ == 2.2.18
21
+
22
+ Enhancements::
23
+
24
+ * Add opt-in support for the PlantUML Smetana layout engine
25
+
3
26
  == 2.2.17
4
27
 
5
28
  Bugfixes::
data/README.adoc CHANGED
@@ -2,9 +2,9 @@
2
2
  Pepijn Van_Eeckhoudt <https://github.com/pepijnve[@pepijnve]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
3
  :description: README for the Asciidoctor Diagram extension for Asciidoctor.
4
4
 
5
- image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/Linux%20unit%20tests/badge.svg?branch=master["Linux Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22Linux+unit+tests%22"]
6
- // image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/macOS%20unit%20tests/badge.svg?branch=master["macOS Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22macOS+unit+tests%22"]
7
- // image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/Windows%20unit%20tests/badge.svg?branch=master["Windows Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22Windows+unit+tests%22"]
5
+ image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/Linux%20unit%20tests/badge.svg?branch=main["Linux Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22Linux+unit+tests%22"]
6
+ // image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/macOS%20unit%20tests/badge.svg?branch=main["macOS Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22macOS+unit+tests%22"]
7
+ // image:https://github.com/asciidoctor/asciidoctor-diagram/workflows/Windows%20unit%20tests/badge.svg?branch=main["Windows Build Status", link="https://github.com/asciidoctor/asciidoctor-diagram/actions?query=workflow%3A%22Windows+unit+tests%22"]
8
8
  image:https://badge.fury.io/rb/asciidoctor-diagram.svg[Gem Version, link=https://rubygems.org/gems/asciidoctor-diagram]
9
9
 
10
10
  Asciidoctor Diagram is a set of Asciidoctor extensions that enable you to add diagrams, which you describe using plain text, to your AsciiDoc document.
@@ -1,7 +1,7 @@
1
1
  require_relative '../diagram_converter'
2
+ require_relative '../util/base64'
2
3
  require_relative '../util/platform'
3
4
 
4
- require 'base64'
5
5
  require 'net/http'
6
6
  require 'uri'
7
7
  require 'zlib'
@@ -47,15 +47,20 @@ module Asciidoctor
47
47
  compressed = deflate.deflate(code, Zlib::FINISH)
48
48
  deflate.close
49
49
 
50
- encoded = Base64.urlsafe_encode64(compressed)
51
- data = '0A' + encoded
50
+ data = Base64.urlsafe_encode(compressed)
51
+ # See https://plantuml.com/text-encoding
52
+ # PlantUML uses a different alphabet than the one from RFC 4648
53
+ data.tr!(
54
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
55
+ '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
56
+ )
52
57
 
53
58
  path = uri.path.dup
54
59
  path << '/' unless path.end_with? '/'
55
60
  path << format.to_s
56
61
  when :kroki_io
57
62
  compressed = Zlib.deflate(code, Zlib::BEST_COMPRESSION)
58
- data = Base64.urlsafe_encode64(compressed)
63
+ data = Base64.urlsafe_encode(compressed)
59
64
 
60
65
  path = uri.path.dup
61
66
  path << '/' unless path.end_with? '/'
@@ -1,10 +1,10 @@
1
- require 'base64'
2
1
  require 'json'
3
2
  require 'sinatra/base'
4
3
  require 'zlib'
5
4
 
6
5
  require_relative '../diagram_source'
7
6
  require_relative '../graphviz/converter'
7
+ require_relative '../util/base64'
8
8
  require_relative '../util/which'
9
9
 
10
10
  module Asciidoctor
@@ -14,7 +14,7 @@ module Asciidoctor
14
14
  type = params['type']
15
15
  accepts = lambda { |t| params['format'].downcase.to_sym == t }
16
16
  raw_source = params['source']
17
- decoded_source = Base64.urlsafe_decode64(raw_source)
17
+ decoded_source = Base64.urlsafe_decode(raw_source)
18
18
  decompressed_source = Zlib::Inflate.inflate(decoded_source)
19
19
  source = decompressed_source
20
20
  render_diagram(type, accepts, source, {})
@@ -37,9 +37,11 @@ module Asciidoctor
37
37
 
38
38
  def collect_options(source)
39
39
  options = {
40
- :size_limit => source.attr('size-limit', '4096')
40
+ :size_limit => source.attr('size-limit', '4096'),
41
41
  }
42
42
 
43
+ options[:smetana] = true if source.opt('smetana')
44
+
43
45
  theme = source.attr('theme', nil)
44
46
  options[:theme] = theme if theme
45
47
 
@@ -106,9 +108,13 @@ module Asciidoctor
106
108
  add_theme_header(headers, options[:theme])
107
109
  add_size_limit_header(headers, options[:size_limit])
108
110
 
109
- dot = source.find_command('dot', :alt_attrs => ['graphvizdot'], :raise_on_error => false)
110
- if dot
111
- headers['X-Graphviz'] = ::Asciidoctor::Diagram::Platform.host_os_path(dot)
111
+ if options[:smetana]
112
+ headers['X-Graphviz'] = 'smetana'
113
+ else
114
+ dot = source.find_command('dot', :alt_attrs => ['graphvizdot'], :raise_on_error => false)
115
+ if dot
116
+ headers['X-Graphviz'] = ::Asciidoctor::Diagram::Platform.host_os_path(dot)
117
+ end
112
118
  end
113
119
 
114
120
  response = Java.send_request(
@@ -17,7 +17,12 @@ module Asciidoctor
17
17
  lib_dir = File.expand_path('lib', CLI_HOME_ENV)
18
18
  Dir.children(lib_dir).select { |c| c.end_with? '.jar' }.map { |c| File.expand_path(c, lib_dir) }
19
19
  else
20
- nil
20
+ begin
21
+ require 'asciidoctor-diagram/jsyntrax/classpath'
22
+ ::Asciidoctor::Diagram::JsyntraxClasspath::JAR_FILES
23
+ rescue LoadError
24
+ nil
25
+ end
21
26
  end
22
27
 
23
28
  if JSYNTRAX_JARS
@@ -15,7 +15,7 @@ module Asciidoctor
15
15
 
16
16
  def collect_options(source)
17
17
  {
18
- :preamble => source.attr('preamble') == 'true'
18
+ :preamble => source.opt('preamble') || source.attr('preamble') == 'true'
19
19
  }
20
20
  end
21
21
 
@@ -0,0 +1,25 @@
1
+ module Asciidoctor
2
+ module Diagram
3
+ module Base64
4
+ def self.urlsafe_encode(bin, padding: true)
5
+ str = [bin].pack("m0")
6
+ str.chomp!("==") or str.chomp!("=") unless padding
7
+ str.tr!("+/", "-_")
8
+ str
9
+ end
10
+
11
+ def self.urlsafe_decode(str)
12
+ # NOTE: RFC 4648 does say nothing about unpadded input, but says that
13
+ # "the excess pad characters MAY also be ignored", so it is inferred that
14
+ # unpadded input is also acceptable.
15
+ if !str.end_with?("=") && str.length % 4 != 0
16
+ str = str.ljust((str.length + 3) & ~3, "=")
17
+ str.tr!("-_", "+/")
18
+ else
19
+ str = str.tr("-_", "+/")
20
+ end
21
+ str.unpack1("m0")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Diagram
3
- VERSION = "2.2.17"
3
+ VERSION = "2.3.1"
4
4
  end
5
5
  end
@@ -35,7 +35,7 @@ module Asciidoctor
35
35
  source.find_command('wavedrom-cli', :attrs => ['wavedrom'])
36
36
  end
37
37
 
38
- if wavedrom.end_with?('-cli')
38
+ if wavedrom.include?('-cli')
39
39
  generate_file(wavedrom, 'wvd', format.to_s, source.to_s) do |tool_path, input_path, output_path|
40
40
  {
41
41
  :args => [Platform.native_path(tool_path), '--input', Platform.native_path(input_path), "--#{format.to_s}", Platform.native_path(output_path)],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-diagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.17
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pepijn Van Eeckhoudt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-02 00:00:00.000000000 Z
11
+ date: 2024-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -156,7 +156,7 @@ files:
156
156
  - lib/asciidoctor-diagram/diagrams/extension.rb
157
157
  - lib/asciidoctor-diagram/ditaa.rb
158
158
  - lib/asciidoctor-diagram/ditaa/converter.rb
159
- - lib/asciidoctor-diagram/ditaa/ditaa-2.0.0.jar
159
+ - lib/asciidoctor-diagram/ditaa/ditaa-2.2.0.jar
160
160
  - lib/asciidoctor-diagram/ditaa/extension.rb
161
161
  - lib/asciidoctor-diagram/dpic.rb
162
162
  - lib/asciidoctor-diagram/dpic/converter.rb
@@ -199,7 +199,7 @@ files:
199
199
  - lib/asciidoctor-diagram/plantuml.rb
200
200
  - lib/asciidoctor-diagram/plantuml/converter.rb
201
201
  - lib/asciidoctor-diagram/plantuml/extension.rb
202
- - lib/asciidoctor-diagram/plantuml/plantuml-2.0.0.jar
202
+ - lib/asciidoctor-diagram/plantuml/plantuml-2.2.1.jar
203
203
  - lib/asciidoctor-diagram/salt.rb
204
204
  - lib/asciidoctor-diagram/shaape.rb
205
205
  - lib/asciidoctor-diagram/shaape/converter.rb
@@ -211,7 +211,7 @@ files:
211
211
  - lib/asciidoctor-diagram/structurizr/converter.rb
212
212
  - lib/asciidoctor-diagram/structurizr/extension.rb
213
213
  - lib/asciidoctor-diagram/structurizr/renderers.rb
214
- - lib/asciidoctor-diagram/structurizr/structurizr-2.0.5.jar
214
+ - lib/asciidoctor-diagram/structurizr/structurizr-2.2.0.jar
215
215
  - lib/asciidoctor-diagram/svgbob.rb
216
216
  - lib/asciidoctor-diagram/svgbob/converter.rb
217
217
  - lib/asciidoctor-diagram/svgbob/extension.rb
@@ -221,13 +221,14 @@ files:
221
221
  - lib/asciidoctor-diagram/syntrax.rb
222
222
  - lib/asciidoctor-diagram/syntrax/converter.rb
223
223
  - lib/asciidoctor-diagram/syntrax/extension.rb
224
- - lib/asciidoctor-diagram/syntrax/syntrax-2.0.2.jar
224
+ - lib/asciidoctor-diagram/syntrax/syntrax-2.2.0.jar
225
225
  - lib/asciidoctor-diagram/tikz.rb
226
226
  - lib/asciidoctor-diagram/tikz/converter.rb
227
227
  - lib/asciidoctor-diagram/tikz/extension.rb
228
228
  - lib/asciidoctor-diagram/umlet.rb
229
229
  - lib/asciidoctor-diagram/umlet/converter.rb
230
230
  - lib/asciidoctor-diagram/umlet/extension.rb
231
+ - lib/asciidoctor-diagram/util/base64.rb
231
232
  - lib/asciidoctor-diagram/util/binaryio.rb
232
233
  - lib/asciidoctor-diagram/util/cli.rb
233
234
  - lib/asciidoctor-diagram/util/cli_generator.rb
@@ -238,7 +239,7 @@ files:
238
239
  - lib/asciidoctor-diagram/util/pdf.rb
239
240
  - lib/asciidoctor-diagram/util/platform.rb
240
241
  - lib/asciidoctor-diagram/util/png.rb
241
- - lib/asciidoctor-diagram/util/server-2.0.0.jar
242
+ - lib/asciidoctor-diagram/util/server-2.2.0.jar
242
243
  - lib/asciidoctor-diagram/util/svg.rb
243
244
  - lib/asciidoctor-diagram/util/which.rb
244
245
  - lib/asciidoctor-diagram/vega.rb
@@ -253,7 +254,7 @@ licenses:
253
254
  - MIT
254
255
  metadata:
255
256
  bug_tracker_uri: https://github.com/asciidoctor/asciidoctor-diagram/issues
256
- changelog_uri: https://github.com/asciidoctor/asciidoctor-diagram/blob/master/CHANGELOG.adoc
257
+ changelog_uri: https://github.com/asciidoctor/asciidoctor-diagram/blob/main/CHANGELOG.adoc
257
258
  documentation_uri: https://docs.asciidoctor.org/diagram-extension/latest/
258
259
  homepage_uri: https://github.com/asciidoctor/asciidoctor-diagram
259
260
  source_code_uri: https://github.com/asciidoctor/asciidoctor-diagram.git