asciidoctor-diagram 1.5.1 → 1.5.2
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 +4 -4
- data/CHANGELOG.adoc +12 -0
- data/README.adoc +4 -1
- data/lib/asciidoctor-diagram.rb +1 -0
- data/lib/asciidoctor-diagram/blockdiag/extension.rb +5 -4
- data/lib/asciidoctor-diagram/erd.rb +7 -0
- data/lib/asciidoctor-diagram/erd/extension.rb +43 -0
- data/lib/asciidoctor-diagram/extensions.rb +9 -5
- data/lib/asciidoctor-diagram/graphviz/extension.rb +2 -1
- data/lib/asciidoctor-diagram/meme/extension.rb +4 -4
- data/lib/asciidoctor-diagram/mermaid/extension.rb +4 -2
- data/lib/asciidoctor-diagram/plantuml/extension.rb +1 -1
- data/lib/asciidoctor-diagram/shaape/extension.rb +2 -1
- data/lib/asciidoctor-diagram/util/cli.rb +19 -0
- data/lib/asciidoctor-diagram/util/cli_generator.rb +5 -15
- data/lib/asciidoctor-diagram/util/java.rb +1 -1
- data/lib/asciidoctor-diagram/util/java_socket.rb +96 -28
- data/lib/asciidoctor-diagram/util/platform.rb +35 -14
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/lib/asciidoctor-diagram/wavedrom/extension.rb +3 -2
- data/spec/blockdiag_spec.rb +15 -15
- data/spec/ditaa_spec.rb +14 -14
- data/spec/erd_spec.rb +289 -0
- data/spec/graphviz_spec.rb +12 -12
- data/spec/meme_spec.rb +6 -6
- data/spec/mermaid_spec.rb +22 -22
- data/spec/plantuml_spec.rb +78 -42
- data/spec/shaape_spec.rb +15 -15
- data/spec/test_helper.rb +8 -3
- data/spec/wavedrom_spec.rb +18 -18
- metadata +8 -4
    
        data/spec/shaape_spec.rb
    CHANGED
    
    | @@ -25,15 +25,15 @@ shaape::shaape.txt[format="png"] | |
| 25 25 | 
             
                d = load_asciidoc doc
         | 
| 26 26 | 
             
                expect(d).to_not be_nil
         | 
| 27 27 |  | 
| 28 | 
            -
                b = d.find { | | 
| 28 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 29 29 | 
             
                expect(b).to_not be_nil
         | 
| 30 30 |  | 
| 31 31 | 
             
                expect(b.content_model).to eq :empty
         | 
| 32 32 |  | 
| 33 33 | 
             
                target = b.attributes['target']
         | 
| 34 34 | 
             
                expect(target).to_not be_nil
         | 
| 35 | 
            -
                expect(target).to match | 
| 36 | 
            -
                expect(File. | 
| 35 | 
            +
                expect(target).to match(/\.png$/)
         | 
| 36 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 37 37 |  | 
| 38 38 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 39 39 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -62,15 +62,15 @@ Doc Writer <doc@example.com> | |
| 62 62 | 
             
                d = load_asciidoc doc
         | 
| 63 63 | 
             
                expect(d).to_not be_nil
         | 
| 64 64 |  | 
| 65 | 
            -
                b = d.find { | | 
| 65 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 66 66 | 
             
                expect(b).to_not be_nil
         | 
| 67 67 |  | 
| 68 68 | 
             
                expect(b.content_model).to eq :empty
         | 
| 69 69 |  | 
| 70 70 | 
             
                target = b.attributes['target']
         | 
| 71 71 | 
             
                expect(target).to_not be_nil
         | 
| 72 | 
            -
                expect(target).to match | 
| 73 | 
            -
                expect(File. | 
| 72 | 
            +
                expect(target).to match(/\.png$/)
         | 
| 73 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 74 74 |  | 
| 75 75 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 76 76 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -97,15 +97,15 @@ Doc Writer <doc@example.com> | |
| 97 97 | 
             
                d = load_asciidoc doc
         | 
| 98 98 | 
             
                expect(d).to_not be_nil
         | 
| 99 99 |  | 
| 100 | 
            -
                b = d.find { | | 
| 100 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 101 101 | 
             
                expect(b).to_not be_nil
         | 
| 102 102 |  | 
| 103 103 | 
             
                expect(b.content_model).to eq :empty
         | 
| 104 104 |  | 
| 105 105 | 
             
                target = b.attributes['target']
         | 
| 106 106 | 
             
                expect(target).to_not be_nil
         | 
| 107 | 
            -
                expect(target).to match | 
| 108 | 
            -
                expect(File. | 
| 107 | 
            +
                expect(target).to match(/\.svg/)
         | 
| 108 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 109 109 |  | 
| 110 110 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 111 111 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -123,7 +123,7 @@ Doc Writer <doc@example.com> | |
| 123 123 | 
             
            ----
         | 
| 124 124 | 
             
                eos
         | 
| 125 125 |  | 
| 126 | 
            -
                expect { load_asciidoc doc }.to raise_error | 
| 126 | 
            +
                expect { load_asciidoc doc }.to raise_error(/support.*format/i)
         | 
| 127 127 | 
             
              end
         | 
| 128 128 |  | 
| 129 129 | 
             
              it "should not regenerate images when source has not changed" do
         | 
| @@ -158,7 +158,7 @@ shaape::shaape.txt | |
| 158 158 | 
             
                eos
         | 
| 159 159 |  | 
| 160 160 | 
             
                d = load_asciidoc doc
         | 
| 161 | 
            -
                b = d.find { | | 
| 161 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 162 162 | 
             
                expect(b).to_not be_nil
         | 
| 163 163 | 
             
                target = b.attributes['target']
         | 
| 164 164 | 
             
                mtime1 = File.mtime(target)
         | 
| @@ -195,7 +195,7 @@ shaape::shaape.txt[] | |
| 195 195 | 
             
                eos
         | 
| 196 196 |  | 
| 197 197 | 
             
                load_asciidoc doc
         | 
| 198 | 
            -
                expect(File. | 
| 198 | 
            +
                expect(File.exist?('shaape.png')).to be true
         | 
| 199 199 | 
             
              end
         | 
| 200 200 |  | 
| 201 201 | 
             
              it "should respect target attribute in block macros" do
         | 
| @@ -221,8 +221,8 @@ shaape::shaape.txt["foobaz"] | |
| 221 221 | 
             
                eos
         | 
| 222 222 |  | 
| 223 223 | 
             
                load_asciidoc doc
         | 
| 224 | 
            -
                expect(File. | 
| 225 | 
            -
                expect(File. | 
| 226 | 
            -
                expect(File. | 
| 224 | 
            +
                expect(File.exist?('foobar.png')).to be true
         | 
| 225 | 
            +
                expect(File.exist?('foobaz.png')).to be true
         | 
| 226 | 
            +
                expect(File.exist?('shaape.png')).to be false
         | 
| 227 227 | 
             
              end
         | 
| 228 228 | 
             
            end
         | 
    
        data/spec/test_helper.rb
    CHANGED
    
    | @@ -8,6 +8,7 @@ require 'tmpdir' | |
| 8 8 | 
             
            require_relative '../lib/asciidoctor-diagram'
         | 
| 9 9 | 
             
            require_relative '../lib/asciidoctor-diagram/blockdiag/extension'
         | 
| 10 10 | 
             
            require_relative '../lib/asciidoctor-diagram/ditaa/extension'
         | 
| 11 | 
            +
            require_relative '../lib/asciidoctor-diagram/erd/extension'
         | 
| 11 12 | 
             
            require_relative '../lib/asciidoctor-diagram/graphviz/extension'
         | 
| 12 13 | 
             
            require_relative '../lib/asciidoctor-diagram/meme/extension'
         | 
| 13 14 | 
             
            require_relative '../lib/asciidoctor-diagram/mermaid/extension'
         | 
| @@ -62,20 +63,24 @@ RSpec.configure do |c| | |
| 62 63 | 
             
                  c.filter_run_excluding :broken_on_windows => true
         | 
| 63 64 | 
             
              end
         | 
| 64 65 |  | 
| 66 | 
            +
              if ENV['TRAVIS']
         | 
| 67 | 
            +
                c.filter_run_excluding :broken_on_travis => true
         | 
| 68 | 
            +
              end
         | 
| 69 | 
            +
             | 
| 65 70 | 
             
              TEST_DIR = File.expand_path('testing')
         | 
| 66 71 |  | 
| 67 72 | 
             
              c.before(:suite) do
         | 
| 68 | 
            -
                FileUtils.rm_r TEST_DIR if Dir. | 
| 73 | 
            +
                FileUtils.rm_r TEST_DIR if Dir.exist? TEST_DIR
         | 
| 69 74 | 
             
                FileUtils.mkdir_p TEST_DIR
         | 
| 70 75 | 
             
              end
         | 
| 71 76 |  | 
| 72 77 | 
             
              c.around(:each) do |example|
         | 
| 73 78 | 
             
                metadata = example.metadata
         | 
| 74 79 | 
             
                group_dir = File.expand_path(metadata[:example_group][:full_description].gsub(/[^\w]+/, '_'), TEST_DIR)
         | 
| 75 | 
            -
                 | 
| 80 | 
            +
                FileUtils.mkdir_p(group_dir) unless Dir.exist?(group_dir)
         | 
| 76 81 |  | 
| 77 82 | 
             
                test_dir = File.expand_path(metadata[:description].gsub(/[^\w]+/, '_'), group_dir)
         | 
| 78 | 
            -
                Dir. | 
| 83 | 
            +
                FileUtils.mkdir_p(test_dir) unless Dir.exist?(test_dir)
         | 
| 79 84 |  | 
| 80 85 | 
             
                Dir.chdir(test_dir) do
         | 
| 81 86 | 
             
                  example.run
         | 
    
        data/spec/wavedrom_spec.rb
    CHANGED
    
    | @@ -24,15 +24,15 @@ wavedrom::wavedrom.txt[format="png"] | |
| 24 24 | 
             
                d = load_asciidoc doc
         | 
| 25 25 | 
             
                expect(d).to_not be_nil
         | 
| 26 26 |  | 
| 27 | 
            -
                b = d.find { | | 
| 27 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 28 28 | 
             
                expect(b).to_not be_nil
         | 
| 29 29 |  | 
| 30 30 | 
             
                expect(b.content_model).to eq :empty
         | 
| 31 31 |  | 
| 32 32 | 
             
                target = b.attributes['target']
         | 
| 33 33 | 
             
                expect(target).to_not be_nil
         | 
| 34 | 
            -
                expect(target).to match | 
| 35 | 
            -
                expect(File. | 
| 34 | 
            +
                expect(target).to match(/\.png$/)
         | 
| 35 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 36 36 |  | 
| 37 37 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 38 38 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -53,15 +53,15 @@ wavedrom::wavedrom.txt[format="svg"] | |
| 53 53 | 
             
                d = load_asciidoc doc
         | 
| 54 54 | 
             
                expect(d).to_not be_nil
         | 
| 55 55 |  | 
| 56 | 
            -
                b = d.find { | | 
| 56 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 57 57 | 
             
                expect(b).to_not be_nil
         | 
| 58 58 |  | 
| 59 59 | 
             
                expect(b.content_model).to eq :empty
         | 
| 60 60 |  | 
| 61 61 | 
             
                target = b.attributes['target']
         | 
| 62 62 | 
             
                expect(target).to_not be_nil
         | 
| 63 | 
            -
                expect(target).to match | 
| 64 | 
            -
                expect(File. | 
| 63 | 
            +
                expect(target).to match(/\.svg/)
         | 
| 64 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 65 65 |  | 
| 66 66 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 67 67 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -85,15 +85,15 @@ Doc Writer <doc@example.com> | |
| 85 85 | 
             
                d = load_asciidoc doc
         | 
| 86 86 | 
             
                expect(d).to_not be_nil
         | 
| 87 87 |  | 
| 88 | 
            -
                b = d.find { | | 
| 88 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 89 89 | 
             
                expect(b).to_not be_nil
         | 
| 90 90 |  | 
| 91 91 | 
             
                expect(b.content_model).to eq :empty
         | 
| 92 92 |  | 
| 93 93 | 
             
                target = b.attributes['target']
         | 
| 94 94 | 
             
                expect(target).to_not be_nil
         | 
| 95 | 
            -
                expect(target).to match | 
| 96 | 
            -
                expect(File. | 
| 95 | 
            +
                expect(target).to match(/\.png$/)
         | 
| 96 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 97 97 |  | 
| 98 98 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 99 99 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -115,15 +115,15 @@ Doc Writer <doc@example.com> | |
| 115 115 | 
             
                d = load_asciidoc doc
         | 
| 116 116 | 
             
                expect(d).to_not be_nil
         | 
| 117 117 |  | 
| 118 | 
            -
                b = d.find { | | 
| 118 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 119 119 | 
             
                expect(b).to_not be_nil
         | 
| 120 120 |  | 
| 121 121 | 
             
                expect(b.content_model).to eq :empty
         | 
| 122 122 |  | 
| 123 123 | 
             
                target = b.attributes['target']
         | 
| 124 124 | 
             
                expect(target).to_not be_nil
         | 
| 125 | 
            -
                expect(target).to match | 
| 126 | 
            -
                expect(File. | 
| 125 | 
            +
                expect(target).to match(/\.svg/)
         | 
| 126 | 
            +
                expect(File.exist?(target)).to be true
         | 
| 127 127 |  | 
| 128 128 | 
             
                expect(b.attributes['width']).to_not be_nil
         | 
| 129 129 | 
             
                expect(b.attributes['height']).to_not be_nil
         | 
| @@ -141,7 +141,7 @@ Doc Writer <doc@example.com> | |
| 141 141 | 
             
            ----
         | 
| 142 142 | 
             
                eos
         | 
| 143 143 |  | 
| 144 | 
            -
                expect { load_asciidoc doc }.to raise_error | 
| 144 | 
            +
                expect { load_asciidoc doc }.to raise_error(/support.*format/i)
         | 
| 145 145 | 
             
              end
         | 
| 146 146 |  | 
| 147 147 | 
             
              it "should not regenerate images when source has not changed" do
         | 
| @@ -162,7 +162,7 @@ wavedrom::wavedrom.txt | |
| 162 162 | 
             
                eos
         | 
| 163 163 |  | 
| 164 164 | 
             
                d = load_asciidoc doc
         | 
| 165 | 
            -
                b = d.find { | | 
| 165 | 
            +
                b = d.find { |bl| bl.context == :image }
         | 
| 166 166 | 
             
                expect(b).to_not be_nil
         | 
| 167 167 | 
             
                target = b.attributes['target']
         | 
| 168 168 | 
             
                mtime1 = File.mtime(target)
         | 
| @@ -190,7 +190,7 @@ wavedrom::wavedrom.txt[] | |
| 190 190 | 
             
                eos
         | 
| 191 191 |  | 
| 192 192 | 
             
                load_asciidoc doc
         | 
| 193 | 
            -
                expect(File. | 
| 193 | 
            +
                expect(File.exist?('wavedrom.png')).to be true
         | 
| 194 194 | 
             
              end
         | 
| 195 195 |  | 
| 196 196 | 
             
              it "should respect target attribute in block macros" do
         | 
| @@ -207,8 +207,8 @@ wavedrom::wavedrom.txt["foobaz"] | |
| 207 207 | 
             
                eos
         | 
| 208 208 |  | 
| 209 209 | 
             
                load_asciidoc doc
         | 
| 210 | 
            -
                expect(File. | 
| 211 | 
            -
                expect(File. | 
| 212 | 
            -
                expect(File. | 
| 210 | 
            +
                expect(File.exist?('foobar.png')).to be true
         | 
| 211 | 
            +
                expect(File.exist?('foobaz.png')).to be true
         | 
| 212 | 
            +
                expect(File.exist?('wavedrom.png')).to be false
         | 
| 213 213 | 
             
              end
         | 
| 214 214 | 
             
            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 | 
            +
              version: 1.5.2
         | 
| 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: 2016- | 
| 11 | 
            +
            date: 2016-10-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -90,6 +90,8 @@ files: | |
| 90 90 | 
             
            - lib/asciidoctor-diagram/blockdiag/extension.rb
         | 
| 91 91 | 
             
            - lib/asciidoctor-diagram/ditaa.rb
         | 
| 92 92 | 
             
            - lib/asciidoctor-diagram/ditaa/extension.rb
         | 
| 93 | 
            +
            - lib/asciidoctor-diagram/erd.rb
         | 
| 94 | 
            +
            - lib/asciidoctor-diagram/erd/extension.rb
         | 
| 93 95 | 
             
            - lib/asciidoctor-diagram/extensions.rb
         | 
| 94 96 | 
             
            - lib/asciidoctor-diagram/graphviz.rb
         | 
| 95 97 | 
             
            - lib/asciidoctor-diagram/graphviz/extension.rb
         | 
| @@ -103,6 +105,7 @@ files: | |
| 103 105 | 
             
            - lib/asciidoctor-diagram/shaape.rb
         | 
| 104 106 | 
             
            - lib/asciidoctor-diagram/shaape/extension.rb
         | 
| 105 107 | 
             
            - lib/asciidoctor-diagram/util/binaryio.rb
         | 
| 108 | 
            +
            - lib/asciidoctor-diagram/util/cli.rb
         | 
| 106 109 | 
             
            - lib/asciidoctor-diagram/util/cli_generator.rb
         | 
| 107 110 | 
             
            - lib/asciidoctor-diagram/util/gif.rb
         | 
| 108 111 | 
             
            - lib/asciidoctor-diagram/util/java.rb
         | 
| @@ -119,6 +122,7 @@ files: | |
| 119 122 | 
             
            - lib/plantuml.jar
         | 
| 120 123 | 
             
            - spec/blockdiag_spec.rb
         | 
| 121 124 | 
             
            - spec/ditaa_spec.rb
         | 
| 125 | 
            +
            - spec/erd_spec.rb
         | 
| 122 126 | 
             
            - spec/graphviz_spec.rb
         | 
| 123 127 | 
             
            - spec/man.jpg
         | 
| 124 128 | 
             
            - spec/meme_spec.rb
         | 
| @@ -147,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 147 151 | 
             
                  version: '0'
         | 
| 148 152 | 
             
            requirements: []
         | 
| 149 153 | 
             
            rubyforge_project: 
         | 
| 150 | 
            -
            rubygems_version: 2. | 
| 154 | 
            +
            rubygems_version: 2.5.1
         | 
| 151 155 | 
             
            signing_key: 
         | 
| 152 156 | 
             
            specification_version: 4
         | 
| 153 157 | 
             
            summary: An extension for asciidoctor that adds support for UML diagram generation
         | 
| @@ -155,6 +159,7 @@ summary: An extension for asciidoctor that adds support for UML diagram generati | |
| 155 159 | 
             
            test_files:
         | 
| 156 160 | 
             
            - spec/blockdiag_spec.rb
         | 
| 157 161 | 
             
            - spec/ditaa_spec.rb
         | 
| 162 | 
            +
            - spec/erd_spec.rb
         | 
| 158 163 | 
             
            - spec/graphviz_spec.rb
         | 
| 159 164 | 
             
            - spec/man.jpg
         | 
| 160 165 | 
             
            - spec/meme_spec.rb
         | 
| @@ -163,4 +168,3 @@ test_files: | |
| 163 168 | 
             
            - spec/shaape_spec.rb
         | 
| 164 169 | 
             
            - spec/test_helper.rb
         | 
| 165 170 | 
             
            - spec/wavedrom_spec.rb
         | 
| 166 | 
            -
            has_rdoc: 
         |