asciidoctor-diagram 1.5.4.1 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de0f65375e0acd83e5884ac89c8151c1fb84fd58
4
- data.tar.gz: 6866a207a0e8976c4d8adde384815d22bd8be118
3
+ metadata.gz: 65e470f480837be7f630896e91d0c61368b8a2f5
4
+ data.tar.gz: 0c674e665f3f412f2181cde62163d116efbfc7de
5
5
  SHA512:
6
- metadata.gz: 17ea60fdf32b733cfc6708a800b69b538ad280148430286c8b7d896f710fd98b3b1209879971e399497073b8d7fa14fdd71d3bdcaec50403b2af8595080b61d4
7
- data.tar.gz: f877d2242b1187f7f20173675950257fde3b749842eb896b2a4fee2a6d77cebedeb2d2ba38e338c4beca6095058a3ac3d22b149d4e63ce2b9b6ee39a51fc9f5d
6
+ metadata.gz: 487247e3185db46d245f2c7e78c43524ed4da61a200e92a2b9984ecab45bbf6db2eee009cc3b66239941af4bc3142944e97ca0ff4daad189966f31ab5a78b39e
7
+ data.tar.gz: 92dfed70c63edf7436f4af7f1ec3b6bdb9e797fcfc953d2d74409cb8d70ed071b104e2bfdd9d597c8f004230f800120bc0ce3cc01f0eeb310ab3af14793db048
@@ -1,17 +1,27 @@
1
1
  = Asciidoctor-diagram Changelog
2
2
 
3
- == 1.5.4.1
3
+ == Development
4
+
5
+ == 1.5.5
4
6
 
5
7
  Enhancements::
6
8
 
9
+ * Update PlantUML to revision 2017.15
10
+ * Issue #147: Add support for PlantUML SVG output (@puffybsd)
7
11
  * Resolve compatibility issues with Asciidoctor 1.5.6 (@robertpanzer, @mojavelinux)
8
12
 
13
+ Bug Fixes::
14
+
15
+ * Issue #145: Incremental runs on documents containing meme diagrams would fail
16
+ * Issue #150: Resolve Ditaa character encoding issues
17
+ * Avoid error when the `PATH` environment variable is not defined (@BrentDouglas)
18
+
9
19
  == 1.5.4
10
20
 
11
21
  Enhancements::
12
22
 
13
- * Add support for UMLet.
14
- * Issue #141: Allow blockdiag fontpath to be specified via attributes
23
+ * Add support for UMLet (@basejumpa)
24
+ * Issue #141: Allow blockdiag fontpath to be specified via attributes (@bithium)
15
25
 
16
26
  Bug Fixes::
17
27
 
@@ -34,7 +44,7 @@ Bug Fixes::
34
44
 
35
45
  Enhancements::
36
46
 
37
- * Apply anti-aliasing to blockdiag generated images
47
+ * Apply anti-aliasing to blockdiag generated images (@bithium)
38
48
  * Issue #118: Add support for Erd.
39
49
 
40
50
  Bug Fixes::
@@ -60,6 +70,7 @@ Enhancements::
60
70
  * Issue #112: Update PlantUML to revision 8043 (19/06/2016)
61
71
  * Issue #114: Asciidoctor Diagram now requires Asciidoctor if it hasn't been loaded already.
62
72
  * Issue #116: Resolve relative paths in PlantUML !include directives
73
+ * Add Chinese README translation (@diguage)
63
74
 
64
75
  == 1.4.0
65
76
 
@@ -88,12 +99,13 @@ Bug Fixes::
88
99
 
89
100
  * Issue #83: Omit stack trace information from error message that gets embedded in the output document
90
101
  * Issue #84: Restore support for specifying the location of the `dot` executable using the `graphvizdot` attribute
102
+ * Avoid deprecation warnings with JRuby 9000 (@robertpanzer)
91
103
 
92
104
  == 1.3.1
93
105
 
94
106
  Bug Fixes::
95
107
 
96
- * Issue #78: Resolve Java launch issues when running in a Cygwin environment
108
+ * Issue #78: Resolve Java launch issues when running in a Cygwin environment (@chanibal)
97
109
 
98
110
  == 1.3.0
99
111
 
@@ -108,11 +120,13 @@ Enhancements::
108
120
  * Remove dependency on RJB to simplify installation (issue #48)
109
121
  * Add diagram scaling support using the scale attribute (issue #58)
110
122
  * Add Ditaa command line option support using the options attribute (issue #69)
123
+ * Add extra usage instructions to README (@nearnshaw)
111
124
 
112
125
  Bug Fixes::
113
126
 
114
127
  * Issue #49: Resolve issue that made Java 6 installation prompt appear on Mac OS X
115
128
  * Issue #51: Resolved issue where PNG files generated by Graphviz were not processed correctly on Windows
129
+ * Fix caching issue on Travis CI (@j-manu)
116
130
 
117
131
  == 1.2.0
118
132
 
@@ -136,9 +150,9 @@ Bug Fixes::
136
150
 
137
151
  Enhancements::
138
152
 
139
- * Use the output directory (outdir attribute) as base directory if it's specified.
153
+ * Use the output directory (outdir attribute) as base directory if it's specified. (@neher)
140
154
  * Do not auto-generate width/height attributes when outputting to a non-HTML backend. This resolves issues with
141
- oversized images in docbook output.
155
+ oversized images in docbook output. (@neher)
142
156
 
143
157
  == 1.1.4
144
158
 
@@ -20,7 +20,7 @@ module Asciidoctor
20
20
  'transparent' => lambda { |o, v| o << '--transparent' if v == 'true'}
21
21
  }
22
22
 
23
- JARS = ['ditaamini-0.10.jar'].map do |jar|
23
+ JARS = ['ditaa-1.3.12.jar', 'ditaamini-0.10.jar'].map do |jar|
24
24
  File.expand_path File.join('../..', jar), File.dirname(__FILE__)
25
25
  end
26
26
  Java.classpath.concat JARS
@@ -282,12 +282,19 @@ module Asciidoctor
282
282
  subclass.option :pos_attrs, ['target', 'format']
283
283
  end
284
284
 
285
+ def apply_target_subs(parent, target)
286
+ if target
287
+ parent.sub_attributes(target, :attribute_missing => 'warn')
288
+ else
289
+ nil
290
+ end
291
+ end
292
+
285
293
  # Creates a FileSource using target as the file name.
286
294
  #
287
295
  # @return [FileSource] a FileSource
288
296
  def create_source(parent, target, attributes)
289
- target = parent.sub_attributes(target, :attribute_missing => 'warn') if target
290
- FileSource.new(parent, target, attributes)
297
+ FileSource.new(parent, apply_target_subs(parent, target), attributes)
291
298
  end
292
299
  end
293
300
 
@@ -326,7 +333,7 @@ module Asciidoctor
326
333
  # @return [String] the base directory against which relative paths in this diagram should be resolved
327
334
  # @abstract
328
335
  def base_dir
329
- raise NotImplementedError.new
336
+ attr('docdir', nil, true)
330
337
  end
331
338
 
332
339
  # Alias for code
@@ -402,10 +409,9 @@ module Asciidoctor
402
409
  protected
403
410
  def resolve_diagram_subs
404
411
  if @attributes.key? 'subs'
405
- subs = @parent_block.resolve_block_subs @attributes['subs'], nil, 'diagram'
406
- subs.empty? ? nil : subs
412
+ @parent_block.resolve_block_subs @attributes['subs'], nil, 'diagram'
407
413
  else
408
- nil
414
+ []
409
415
  end
410
416
  end
411
417
 
@@ -430,10 +436,6 @@ module Asciidoctor
430
436
  @reader = reader
431
437
  end
432
438
 
433
- def base_dir
434
- attr('docdir', nil, true)
435
- end
436
-
437
439
  def code
438
440
  @code ||= @parent_block.apply_subs(@reader.lines, resolve_diagram_subs).join("\n")
439
441
  end
@@ -447,7 +449,11 @@ module Asciidoctor
447
449
  end
448
450
 
449
451
  def base_dir
450
- File.dirname(@file_name)
452
+ if @file_name
453
+ File.dirname(@file_name)
454
+ else
455
+ super
456
+ end
451
457
  end
452
458
 
453
459
  def image_name
@@ -461,7 +467,7 @@ module Asciidoctor
461
467
  end
462
468
 
463
469
  def should_process?(image_file, image_metadata)
464
- File.mtime(@file_name) > File.mtime(image_file) || super
470
+ (@file_name && File.mtime(@file_name) > File.mtime(image_file)) || super
465
471
  end
466
472
 
467
473
  def code
@@ -107,12 +107,22 @@ module Asciidoctor
107
107
  class MemeBlockMacroProcessor < Extensions::DiagramBlockMacroProcessor
108
108
  include Meme
109
109
 
110
+ class StringReader
111
+ def initialize(str)
112
+ @str = str
113
+ end
114
+
115
+ def lines
116
+ @str.lines.map { |l| l.rstrip }
117
+ end
118
+ end
119
+
110
120
  option :pos_attrs, %w(top bottom target format)
111
121
 
112
122
  def create_source(parent, target, attributes)
113
123
  attributes = attributes.dup
114
- attributes['background'] = target
115
- ::Asciidoctor::Diagram::Extensions::FileSource.new(parent, nil, attributes)
124
+ attributes['background'] = apply_target_subs(parent, target)
125
+ ::Asciidoctor::Diagram::Extensions::ReaderSource.new(parent, StringReader.new(''), attributes)
116
126
  end
117
127
  end
118
128
  end
@@ -10,7 +10,7 @@ module Asciidoctor
10
10
 
11
11
  private
12
12
 
13
- JARS = ['plantuml.jar'].map do |jar|
13
+ JARS = ['plantuml-1.3.12.jar', 'plantuml.jar', 'jlatexmath-minimal-1.0.3.jar', 'batik-all-1.7.jar'].map do |jar|
14
14
  File.expand_path File.join('../..', jar), File.dirname(__FILE__)
15
15
  end
16
16
  Java.classpath.concat JARS
@@ -6,7 +6,7 @@ module Asciidoctor
6
6
  module Java
7
7
  def self.classpath
8
8
  @classpath ||= [
9
- File.expand_path(File.join('../..', 'asciidoctor-diagram-java-1.3.10.jar'), File.dirname(__FILE__))
9
+ File.expand_path(File.join('../..', 'server-1.3.12.jar'), File.dirname(__FILE__))
10
10
  ]
11
11
  end
12
12
 
@@ -5,7 +5,7 @@ module Asciidoctor
5
5
  def self.which(cmd, options = {})
6
6
  exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
7
7
 
8
- paths = (options[:path] || []) + ENV['PATH'].split(File::PATH_SEPARATOR)
8
+ paths = (options[:path] || []) + (ENV['PATH'] ? ENV['PATH'].split(File::PATH_SEPARATOR) : [])
9
9
  paths.each do |path|
10
10
  exts.each { |ext|
11
11
  exe = File.join(path, "#{cmd}#{ext}")
@@ -46,4 +46,4 @@ module Asciidoctor
46
46
  end
47
47
  end
48
48
  end
49
- end
49
+ end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Diagram
3
- VERSION = "1.5.4.1"
3
+ VERSION = "1.5.5"
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -186,4 +186,33 @@ Doc Writer <doc@example.com>
186
186
 
187
187
  expect(mtime2).to be > mtime1
188
188
  end
189
+
190
+ it "should support UTF-8 characters" do
191
+ doc = <<-eos
192
+ = Test
193
+
194
+ [ditaa]
195
+ ----
196
+ /-----\\
197
+ |\u00AB \u2026 \u00BB|
198
+ \\-----/
199
+ ----
200
+ eos
201
+
202
+ d = load_asciidoc doc
203
+ expect(d).to_not be_nil
204
+
205
+ b = d.find { |bl| bl.context == :image }
206
+ expect(b).to_not be_nil
207
+
208
+ expect(b.content_model).to eq :empty
209
+
210
+ target = b.attributes['target']
211
+ expect(target).to_not be_nil
212
+ expect(target).to match(/\.png$/)
213
+ expect(File.exist?(target)).to be true
214
+
215
+ expect(b.attributes['width']).to_not be_nil
216
+ expect(b.attributes['height']).to_not be_nil
217
+ end
189
218
  end
@@ -730,4 +730,125 @@ class {child-class}
730
730
  expect(content).to include('ParentClass')
731
731
  expect(content).to include('ChildClass')
732
732
  end
733
+
734
+ it "should generate PNG images for jlatexmath blocks when format is set to 'png'" do
735
+ doc = <<-eos
736
+ = Hello, PlantUML!
737
+ Doc Writer <doc@example.com>
738
+
739
+ == First Section
740
+
741
+ [plantuml,format="png"]
742
+ ----
743
+ @startlatex
744
+ e^{i\\pi} + 1 = 0
745
+ @endlatex
746
+ ----
747
+ eos
748
+
749
+ d = load_asciidoc doc
750
+ expect(d).to_not be_nil
751
+
752
+ b = d.find { |bl| bl.context == :image }
753
+ expect(b).to_not be_nil
754
+
755
+ expect(b.content_model).to eq :empty
756
+
757
+ target = b.attributes['target']
758
+ expect(target).to_not be_nil
759
+ expect(target).to match(/\.png$/)
760
+ expect(File.exist?(target)).to be true
761
+
762
+ expect(b.attributes['width']).to_not be_nil
763
+ expect(b.attributes['height']).to_not be_nil
764
+ end
765
+
766
+ it "should generate SVG images for jlatexmath blocks when format is set to 'svg'" do
767
+ doc = <<-eos
768
+ = Hello, PlantUML!
769
+ Doc Writer <doc@example.com>
770
+
771
+ == First Section
772
+
773
+ [plantuml,format="svg"]
774
+ ----
775
+ @startlatex
776
+ e^{i\\pi} + 1 = 0
777
+ @endlatex
778
+ ----
779
+ eos
780
+
781
+ d = load_asciidoc doc
782
+ expect(d).to_not be_nil
783
+
784
+ b = d.find { |bl| bl.context == :image }
785
+ expect(b).to_not be_nil
786
+
787
+ expect(b.content_model).to eq :empty
788
+
789
+ target = b.attributes['target']
790
+ expect(target).to_not be_nil
791
+ expect(target).to match(/\.svg$/)
792
+ expect(File.exist?(target)).to be true
793
+ end
794
+
795
+ it "should generate PNG images for diagrams with latex tags when format is set to 'png'" do
796
+ doc = <<-eos
797
+ = Hello, PlantUML!
798
+ Doc Writer <doc@example.com>
799
+
800
+ == First Section
801
+
802
+ [plantuml,format="png"]
803
+ ----
804
+ :<latex>P(y|\\mathbf{x}) \\mbox{ or } f(\\mathbf{x})+\\epsilon</latex>;
805
+ ----
806
+ eos
807
+
808
+ d = load_asciidoc doc
809
+ expect(d).to_not be_nil
810
+
811
+ b = d.find { |bl| bl.context == :image }
812
+ expect(b).to_not be_nil
813
+
814
+ expect(b.content_model).to eq :empty
815
+
816
+ target = b.attributes['target']
817
+ expect(target).to_not be_nil
818
+ expect(target).to match(/\.png$/)
819
+ expect(File.exist?(target)).to be true
820
+
821
+ expect(b.attributes['width']).to_not be_nil
822
+ expect(b.attributes['height']).to_not be_nil
823
+ end
824
+
825
+ it "should generate SVG images for diagrams with latex tags when format is set to 'svg'" do
826
+ doc = <<-eos
827
+ = Hello, PlantUML!
828
+ Doc Writer <doc@example.com>
829
+
830
+ == First Section
831
+
832
+ [plantuml,format="svg"]
833
+ ----
834
+ :<latex>P(y|\\mathbf{x}) \\mbox{ or } f(\\mathbf{x})+\\epsilon</latex>;
835
+ ----
836
+ eos
837
+
838
+ d = load_asciidoc doc
839
+ expect(d).to_not be_nil
840
+
841
+ b = d.find { |bl| bl.context == :image }
842
+ expect(b).to_not be_nil
843
+
844
+ expect(b.content_model).to eq :empty
845
+
846
+ target = b.attributes['target']
847
+ expect(target).to_not be_nil
848
+ expect(target).to match(/\.svg$/)
849
+ expect(File.exist?(target)).to be true
850
+
851
+ expect(b.attributes['width']).to_not be_nil
852
+ expect(b.attributes['height']).to_not be_nil
853
+ end
733
854
  end
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: 1.5.4.1
4
+ version: 1.5.5
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: 2017-07-30 00:00:00.000000000 Z
11
+ date: 2017-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,7 +84,6 @@ files:
84
84
  - examples/features.adoc
85
85
  - images/asciidoctor-diagram-classes.png
86
86
  - images/asciidoctor-diagram-process.png
87
- - lib/asciidoctor-diagram-java-1.3.10.jar
88
87
  - lib/asciidoctor-diagram.rb
89
88
  - lib/asciidoctor-diagram/blockdiag.rb
90
89
  - lib/asciidoctor-diagram/blockdiag/extension.rb
@@ -121,8 +120,13 @@ files:
121
120
  - lib/asciidoctor-diagram/version.rb
122
121
  - lib/asciidoctor-diagram/wavedrom.rb
123
122
  - lib/asciidoctor-diagram/wavedrom/extension.rb
123
+ - lib/batik-all-1.7.jar
124
+ - lib/ditaa-1.3.12.jar
124
125
  - lib/ditaamini-0.10.jar
126
+ - lib/jlatexmath-minimal-1.0.3.jar
127
+ - lib/plantuml-1.3.12.jar
125
128
  - lib/plantuml.jar
129
+ - lib/server-1.3.12.jar
126
130
  - spec/blockdiag_spec.rb
127
131
  - spec/ditaa_spec.rb
128
132
  - spec/erd_spec.rb