lutaml-uml 0.2.1 → 0.2.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b549fe48dc2957bc3f44d69d32f0727af97ec27755e35f47a2580a307e01edb6
|
4
|
+
data.tar.gz: f9ce93042ba36d940323413f03ffc952b1c174beedc81441a2cd7e7b37a4fa5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3070e60d69100ce2696ab9e4e9efb89ad6331fcf962da7b16222107a18b681faddae48cad66ea2b0d6a03c5871583a299d6d5ab9a41ea8f4451844cfa5d9023
|
7
|
+
data.tar.gz: f09245563a2441c7a3714763e820998341d949d6c2c51b4e12599109c3583513cbe1a85c0d3fca3407fe6b5c2c2bd743e679e39a1755c565b7fd1b4b6bd58df7
|
data/.github/workflows/macos.yml
CHANGED
@@ -7,21 +7,12 @@ module Lutaml
|
|
7
7
|
module Layout
|
8
8
|
class GraphVizEngine < Engine
|
9
9
|
def render(type)
|
10
|
-
|
11
|
-
.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
# GraphViz#parse_string and GraphViz#parse crush with no reason
|
17
|
-
# with seg fault, this lead to nil return value.
|
18
|
-
# Try to recall method several time
|
19
|
-
def parse_graphviz_string(attempts = 10)
|
20
|
-
raise('Cannot parse input string, `gvpr` segmentation fault?') if attempts == 0
|
21
|
-
res = GraphViz.parse_string(input)
|
22
|
-
return res if res
|
23
|
-
|
24
|
-
parse_graphviz_string(attempts - 1)
|
10
|
+
Open3.popen3("dot -T#{type}") do |stdin, stdout, _stderr, _wait|
|
11
|
+
stdin.puts(input)
|
12
|
+
stdin.close
|
13
|
+
# unless (err = stderr.read).empty? then raise err end
|
14
|
+
stdout.read
|
15
|
+
end
|
25
16
|
end
|
26
17
|
end
|
27
18
|
end
|
data/lib/lutaml/uml/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe Lutaml::Layout::GraphVizEngine do
|
6
|
+
describe "#render" do
|
7
|
+
subject(:render) do
|
8
|
+
described_class.new(input: input).render(type)
|
9
|
+
end
|
10
|
+
let(:input) do
|
11
|
+
File.read(fixtures_path("generated_dot/AddressClassProfile.dot"))
|
12
|
+
end
|
13
|
+
|
14
|
+
context "when png output type" do
|
15
|
+
let(:type) { "png" }
|
16
|
+
let(:png_header) { "\x89PNG" }
|
17
|
+
|
18
|
+
it "renders input as png binary string" do
|
19
|
+
expect(render[0..3]).to(eq(png_header))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context "when dot output type" do
|
24
|
+
let(:type) { "dot" }
|
25
|
+
|
26
|
+
it "renders input as dot string" do
|
27
|
+
expect(render).to(match("digraph G {"))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lutaml-uml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -303,6 +303,7 @@ files:
|
|
303
303
|
- spec/fixtures/dsl/shared1.lutaml
|
304
304
|
- spec/fixtures/generated_dot/AddressClassProfile.dot
|
305
305
|
- spec/fixtures/generated_dot/AddressProfile.dot
|
306
|
+
- spec/lutaml/layout/graph_viz_engine_spec.rb
|
306
307
|
- spec/lutaml/uml/formatter/graphviz_spec.rb
|
307
308
|
- spec/lutaml/uml/parsers/dsl_spec.rb
|
308
309
|
- spec/lutaml/uml/parsers/yaml_spec.rb
|