lutaml-uml 0.4.1 → 0.4.3
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/LUTAML.adoc +46 -18
- data/lib/lutaml/uml/association.rb +2 -0
- data/lib/lutaml/uml/parsers/dsl.rb +2 -2
- data/lib/lutaml/uml/top_element_attribute.rb +1 -0
- data/lib/lutaml/uml/version.rb +1 -1
- data/spec/fixtures/dsl/diagram_attributes.lutaml +2 -1
- data/spec/lutaml/uml/parsers/dsl_spec.rb +3 -1
- 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: 5d7db5a90a481773906ffcd2985d36777ba62f2c79a1de83390c7890a4c9f7c4
|
4
|
+
data.tar.gz: 7d9229702c7b58d2a2d0c8f2261230eb941f7fd76a0f17c784d48da01a22c5c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec111d11c2354621c95c3708296356906977f9c949f96a07c8e1ee71928733ff68089b5339bb2017f824fa76274fe2e043693ca48b7cbd1305c85756791097a0
|
7
|
+
data.tar.gz: 81de391a9fc9a1d546d82dcfde50b802a67e4bc28ffee88f08699faa6f54b3e7052107e2824c77dfd2b5cd40f3c78518757e7e1955c2715584225508f543389d
|
data/LUTAML.adoc
CHANGED
@@ -21,7 +21,9 @@ where:
|
|
21
21
|
|
22
22
|
== DataTypes
|
23
23
|
|
24
|
-
Lutaml supports 3 types of data_types: `data_type`, `primitive` and `enum`.
|
24
|
+
Lutaml supports 3 types of data_types: `data_type`, `primitive` and `enum`.
|
25
|
+
|
26
|
+
Example of data types declaration:
|
25
27
|
|
26
28
|
[source,java]
|
27
29
|
----
|
@@ -67,8 +69,8 @@ association name {
|
|
67
69
|
|
68
70
|
where:
|
69
71
|
|
70
|
-
* `owned_type` - optional, use to define bidirectional association(association
|
71
|
-
* `member_type` - association type(association
|
72
|
+
* `owned_type` - optional, use to define a bidirectional association (`association`|`composition`|`aggregation`|`generalization`|`uses`)
|
73
|
+
* `member_type` - association type (`association`|`composition`|`aggregation`|`generalization`|`uses`)
|
72
74
|
* `owned|member` - end of association, use `\#attribute_name` to set a role name
|
73
75
|
* `property_string` - property string for attibutes associations
|
74
76
|
* `cardinality` - examples: '1..*', '*'
|
@@ -142,7 +144,12 @@ Full syntax:
|
|
142
144
|
|
143
145
|
where:
|
144
146
|
|
145
|
-
* `visibility` can be equal to
|
147
|
+
* `visibility` can be equal to
|
148
|
+
** `-`: private
|
149
|
+
** `+`: public
|
150
|
+
** `#`: protected
|
151
|
+
** `~`: friendly
|
152
|
+
|
146
153
|
* `attribute` - attrbute keyword
|
147
154
|
* `/` - symbolizes a derived attribute.
|
148
155
|
* `multiplicity` - Multiplicity is in square brackets (e.g. [1..*]).
|
@@ -178,14 +185,17 @@ enum A {
|
|
178
185
|
}
|
179
186
|
----
|
180
187
|
|
188
|
+
[[attribute-visibility]]
|
181
189
|
=== Attribute visibility
|
182
190
|
|
183
|
-
Syntax for defining visibility: [+|-|#|~] [attribute] attribute_name
|
191
|
+
Syntax for defining visibility: `[+|-|#|~] [attribute] attribute_name`.
|
184
192
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
193
|
+
LutaML uses these modificators to define attribute (entry) visbility:
|
194
|
+
|
195
|
+
`+`:: public
|
196
|
+
`-`:: private
|
197
|
+
`#`:: protected
|
198
|
+
`~`:: package
|
189
199
|
|
190
200
|
example:
|
191
201
|
|
@@ -226,9 +236,20 @@ Syntax for defining methods:
|
|
226
236
|
----
|
227
237
|
|
228
238
|
where:
|
229
|
-
|
230
|
-
|
231
|
-
|
239
|
+
|
240
|
+
* `visibility` can be equal to
|
241
|
+
** `-`: private
|
242
|
+
** `+`: public
|
243
|
+
** `#`: protected
|
244
|
+
** `~`: friendly
|
245
|
+
|
246
|
+
* `parameter-list`: parameter list
|
247
|
+
|
248
|
+
* `property-modifier`: can be equal to
|
249
|
+
** `redefines`
|
250
|
+
** `query`
|
251
|
+
** `ordered` (defaults to `unordered`)
|
252
|
+
** `unique`(defaults to `nonunique`)
|
232
253
|
|
233
254
|
Syntax for a `parameter-list`:
|
234
255
|
|
@@ -238,7 +259,12 @@ Syntax for a `parameter-list`:
|
|
238
259
|
----
|
239
260
|
|
240
261
|
where:
|
241
|
-
|
262
|
+
|
263
|
+
* `direction` can be equal to
|
264
|
+
** `in`
|
265
|
+
** `out`
|
266
|
+
** `inout`
|
267
|
+
** `return`
|
242
268
|
|
243
269
|
== import files
|
244
270
|
|
@@ -252,7 +278,8 @@ include path/to/file
|
|
252
278
|
== Package syntax
|
253
279
|
|
254
280
|
Namespaces
|
255
|
-
|
281
|
+
|
282
|
+
A named element is an element that can have a name and a defined visibility (public, private, protected, package):
|
256
283
|
|
257
284
|
[source,java]
|
258
285
|
----
|
@@ -286,7 +313,8 @@ abstract class Pet {}
|
|
286
313
|
== Comment objects diagram
|
287
314
|
|
288
315
|
Use `\**`(one line comment) or `*| |*`(multiline comment) to create comment object for diagram entry.
|
289
|
-
|
316
|
+
|
317
|
+
If this syntax is used inside a `class`/`enum`/`association` block, it will be created for owner of this block.
|
290
318
|
|
291
319
|
[source,java]
|
292
320
|
----
|
@@ -313,7 +341,7 @@ enum B {
|
|
313
341
|
|
314
342
|
== Syntax comments
|
315
343
|
|
316
|
-
Use `//` to create syntax comment, chars after
|
344
|
+
Use `//` to create syntax comment, chars after `//` will be ignored during processing.
|
317
345
|
|
318
346
|
[source,java]
|
319
347
|
----
|
@@ -328,7 +356,7 @@ enum B {
|
|
328
356
|
|
329
357
|
== Value specification
|
330
358
|
|
331
|
-
A value specification indicates one or several values in a model. Examples for value specifications include simple, mathematical expressions, such as 4+2
|
359
|
+
A value specification indicates one or several values in a model. Examples for value specifications include simple, mathematical expressions, such as `4+2`, and expressions with values from the object model, `Integer::MAX_INT-1`
|
332
360
|
|
333
361
|
[source,java]
|
334
362
|
----
|
@@ -341,4 +369,4 @@ instance :{Class name, if any} {as ref name, optional} {
|
|
341
369
|
{attribute name} = {attribute value}
|
342
370
|
{attribute name}:{attribute class} = {attribute value}
|
343
371
|
}
|
344
|
-
----
|
372
|
+
----
|
@@ -151,14 +151,14 @@ module Lutaml
|
|
151
151
|
rule(:title_keyword) { kw_title >> spaces }
|
152
152
|
rule(:title_text) do
|
153
153
|
match['"\''].maybe >>
|
154
|
-
match['a-zA-Z0-9_\- '].repeat(1).as(:title) >>
|
154
|
+
match['a-zA-Z0-9_\- ,.:;'].repeat(1).as(:title) >>
|
155
155
|
match['"\''].maybe
|
156
156
|
end
|
157
157
|
rule(:title_definition) { title_keyword >> title_text }
|
158
158
|
rule(:caption_keyword) { kw_caption >> spaces }
|
159
159
|
rule(:caption_text) do
|
160
160
|
match['"\''].maybe >>
|
161
|
-
match['a-zA-Z0-9_\- '].repeat(1).as(:caption) >>
|
161
|
+
match['a-zA-Z0-9_\- ,.:;'].repeat(1).as(:caption) >>
|
162
162
|
match['"\''].maybe
|
163
163
|
end
|
164
164
|
rule(:caption_definition) { caption_keyword >> caption_text }
|
data/lib/lutaml/uml/version.rb
CHANGED
@@ -34,7 +34,9 @@ RSpec.describe Lutaml::Uml::Parsers::Dsl do
|
|
34
34
|
|
35
35
|
it "creates Lutaml::Uml::Document object and sets its attributes" do
|
36
36
|
expect(parse).to be_instance_of(Lutaml::Uml::Document)
|
37
|
-
expect(parse.title).to eq("my diagram")
|
37
|
+
expect(parse.title).to eq("my diagram, another symbols: text.")
|
38
|
+
expect(parse.caption)
|
39
|
+
.to(eq("Block elements of StandardDocument, adapted from BasicDocument. Another - symbol"))
|
38
40
|
expect(parse.fontname).to eq("Arial")
|
39
41
|
end
|
40
42
|
|
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.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|