lutaml-uml 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/yaml2lutaml +2 -2
- data/lib/lutaml/uml/class.rb +0 -5
- data/lib/lutaml/uml/enum.rb +0 -4
- data/lib/lutaml/uml/parsers/dsl.rb +4 -4
- data/lib/lutaml/uml/top_element.rb +11 -0
- data/lib/lutaml/uml/top_element_attribute.rb +10 -0
- data/lib/lutaml/uml/version.rb +1 -1
- data/spec/fixtures/dsl/diagram_definitions.lutaml +2 -0
- data/spec/lutaml/uml/parsers/dsl_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef28b2562bcae4b385b3be898a71d6c326c59d5167c94ee1231932df060d5eee
|
4
|
+
data.tar.gz: 39519359dc16f9532379b5ce15aef7e8ed6d37a1ae5afa2e22253c025505d0ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b2464f9bc2d0f95a3baf5025ca2853537e6abd175a62be6f4f427e7f5f3e13f75f7ec9d2f7c9a675bd17be67b913da3a0b690c806e63a12f0633187471a6ec6
|
7
|
+
data.tar.gz: 72a944718bd7c57c8146197f10810b40a4026cf71150f65b0ce7c17158bf046815ce71da1845c8b9d6d720521fa693fb006a50c8e02fac31b44ad8ae2b521fc3
|
data/bin/yaml2lutaml
CHANGED
data/lib/lutaml/uml/class.rb
CHANGED
@@ -16,7 +16,6 @@ module Lutaml
|
|
16
16
|
|
17
17
|
attr_reader :associations,
|
18
18
|
:attributes,
|
19
|
-
:definition,
|
20
19
|
:members,
|
21
20
|
:modifier
|
22
21
|
|
@@ -32,10 +31,6 @@ module Lutaml
|
|
32
31
|
@modifier = value.to_s # TODO: Validate?
|
33
32
|
end
|
34
33
|
|
35
|
-
def definition=(value)
|
36
|
-
@definition = value.to_s
|
37
|
-
end
|
38
|
-
|
39
34
|
def attributes=(value)
|
40
35
|
@attributes = value.to_a.map do |attr|
|
41
36
|
TopElementAttribute.new(attr)
|
data/lib/lutaml/uml/enum.rb
CHANGED
@@ -82,9 +82,9 @@ module Lutaml
|
|
82
82
|
str(")")).maybe
|
83
83
|
end
|
84
84
|
rule(:cardinality_body_definition) do
|
85
|
-
match['0-9\*'].as(
|
85
|
+
match['0-9\*'].as('min') >>
|
86
86
|
str("..").maybe >>
|
87
|
-
match['0-9\*'].as(
|
87
|
+
match['0-9\*'].as('max').maybe
|
88
88
|
end
|
89
89
|
rule(:cardinality) do
|
90
90
|
str("[") >>
|
@@ -293,9 +293,9 @@ module Lutaml
|
|
293
293
|
whitespace? >>
|
294
294
|
str("{") >>
|
295
295
|
whitespace? >>
|
296
|
-
(
|
296
|
+
(match("[\n\s]}").absent? >> any).repeat.as(:definition) >>
|
297
297
|
whitespace? >>
|
298
|
-
str(
|
298
|
+
str('}')
|
299
299
|
end
|
300
300
|
|
301
301
|
# -- Enum
|
@@ -6,6 +6,7 @@ module Lutaml
|
|
6
6
|
include HasAttributes
|
7
7
|
|
8
8
|
attr_accessor :name,
|
9
|
+
:definition,
|
9
10
|
:xmi_id,
|
10
11
|
:xmi_uuid,
|
11
12
|
:namespace,
|
@@ -42,6 +43,16 @@ module Lutaml
|
|
42
43
|
|
43
44
|
the_name
|
44
45
|
end
|
46
|
+
|
47
|
+
def definition=(value)
|
48
|
+
@definition = value
|
49
|
+
.to_s
|
50
|
+
.gsub(/\\}/, '}')
|
51
|
+
.gsub(/\\{/, '{')
|
52
|
+
.split("\n")
|
53
|
+
.map(&:strip)
|
54
|
+
.join("\n")
|
55
|
+
end
|
45
56
|
end
|
46
57
|
end
|
47
58
|
end
|
@@ -21,6 +21,16 @@ module Lutaml
|
|
21
21
|
update_attributes(attributes)
|
22
22
|
end
|
23
23
|
# rubocop:enable Rails/ActiveRecordAliases
|
24
|
+
|
25
|
+
def definition=(value)
|
26
|
+
@definition = value
|
27
|
+
.to_s
|
28
|
+
.gsub(/\\}/, '}')
|
29
|
+
.gsub(/\\{/, '{')
|
30
|
+
.split("\n")
|
31
|
+
.map(&:strip)
|
32
|
+
.join("\n")
|
33
|
+
end
|
24
34
|
end
|
25
35
|
end
|
26
36
|
end
|
data/lib/lutaml/uml/version.rb
CHANGED
@@ -6,6 +6,7 @@ diagram MyView {
|
|
6
6
|
this is multiline with `ascidoc`
|
7
7
|
comments
|
8
8
|
and list
|
9
|
+
\{foo\} \{name\}
|
9
10
|
}
|
10
11
|
+addressClassProfile: CharacterString [0..1]
|
11
12
|
}
|
@@ -16,6 +17,7 @@ diagram MyView {
|
|
16
17
|
{
|
17
18
|
this is attribute definition
|
18
19
|
with multiply lines
|
20
|
+
\{foo\} \{name\}
|
19
21
|
end definition
|
20
22
|
}
|
21
23
|
}
|
@@ -121,7 +121,7 @@ RSpec.describe Lutaml::Uml::Parsers::Dsl do
|
|
121
121
|
expect(association.member_end).to(eq("AttributeProfile"))
|
122
122
|
expect(association.member_end_attribute_name)
|
123
123
|
.to(eq("attributeProfile"))
|
124
|
-
expect(association.member_end_cardinality).to(eq(min
|
124
|
+
expect(association.member_end_cardinality).to(eq("min" => "0", "max" => "*"))
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
@@ -254,10 +254,10 @@ RSpec.describe Lutaml::Uml::Parsers::Dsl do
|
|
254
254
|
File.new(fixtures_path("dsl/diagram_definitions.lutaml"))
|
255
255
|
end
|
256
256
|
let(:class_definition) do
|
257
|
-
"this is multiline with `ascidoc`\
|
257
|
+
"this is multiline with `ascidoc`\ncomments\nand list\n{foo} {name}"
|
258
258
|
end
|
259
259
|
let(:attribute_definition) do
|
260
|
-
"this is attribute definition\
|
260
|
+
"this is attribute definition\nwith multiply lines\n{foo} {name}\nend definition"
|
261
261
|
end
|
262
262
|
|
263
263
|
it "create comments for document and classes" do
|
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.8
|
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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|