lutaml-uml 0.4.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +22 -0
  3. data/Gemfile +1 -5
  4. data/README.adoc +4 -42
  5. data/Rakefile +0 -5
  6. data/lutaml-uml.gemspec +23 -38
  7. metadata +20 -292
  8. data/.github/workflows/macos.yml +0 -38
  9. data/.github/workflows/ubuntu.yml +0 -40
  10. data/.github/workflows/windows.yml +0 -51
  11. data/.gitignore +0 -12
  12. data/.rspec +0 -3
  13. data/.travis.yml +0 -6
  14. data/CODE_OF_CONDUCT.md +0 -74
  15. data/LUTAML.adoc +0 -372
  16. data/bin/console +0 -15
  17. data/bin/folder_yaml2lutaml.sh +0 -6
  18. data/bin/plantuml2lutaml +0 -59
  19. data/bin/setup +0 -8
  20. data/bin/yaml2lutaml +0 -144
  21. data/exe/lutaml-wsd2uml +0 -59
  22. data/exe/lutaml-yaml2uml +0 -144
  23. data/lib/lutaml/layout/engine.rb +0 -15
  24. data/lib/lutaml/layout/graph_viz_engine.rb +0 -19
  25. data/lib/lutaml/uml/abstraction.rb +0 -11
  26. data/lib/lutaml/uml/activity.rb +0 -11
  27. data/lib/lutaml/uml/actor.rb +0 -19
  28. data/lib/lutaml/uml/association.rb +0 -43
  29. data/lib/lutaml/uml/behavior.rb +0 -11
  30. data/lib/lutaml/uml/class.rb +0 -83
  31. data/lib/lutaml/uml/classifier.rb +0 -11
  32. data/lib/lutaml/uml/connector.rb +0 -21
  33. data/lib/lutaml/uml/constraint.rb +0 -12
  34. data/lib/lutaml/uml/constructor_end.rb +0 -16
  35. data/lib/lutaml/uml/data_type.rb +0 -75
  36. data/lib/lutaml/uml/dependency.rb +0 -21
  37. data/lib/lutaml/uml/diagram.rb +0 -8
  38. data/lib/lutaml/uml/document.rb +0 -81
  39. data/lib/lutaml/uml/enum.rb +0 -45
  40. data/lib/lutaml/uml/event.rb +0 -12
  41. data/lib/lutaml/uml/final_state.rb +0 -11
  42. data/lib/lutaml/uml/formatter/base.rb +0 -67
  43. data/lib/lutaml/uml/formatter/graphviz.rb +0 -334
  44. data/lib/lutaml/uml/formatter.rb +0 -21
  45. data/lib/lutaml/uml/has_attributes.rb +0 -14
  46. data/lib/lutaml/uml/has_members.rb +0 -30
  47. data/lib/lutaml/uml/instance.rb +0 -17
  48. data/lib/lutaml/uml/model.rb +0 -13
  49. data/lib/lutaml/uml/node/base.rb +0 -21
  50. data/lib/lutaml/uml/node/class_node.rb +0 -57
  51. data/lib/lutaml/uml/node/class_relationship.rb +0 -14
  52. data/lib/lutaml/uml/node/document.rb +0 -18
  53. data/lib/lutaml/uml/node/field.rb +0 -34
  54. data/lib/lutaml/uml/node/has_name.rb +0 -15
  55. data/lib/lutaml/uml/node/has_type.rb +0 -15
  56. data/lib/lutaml/uml/node/method.rb +0 -29
  57. data/lib/lutaml/uml/node/method_argument.rb +0 -16
  58. data/lib/lutaml/uml/node/relationship.rb +0 -28
  59. data/lib/lutaml/uml/opaque_behavior.rb +0 -11
  60. data/lib/lutaml/uml/operation.rb +0 -31
  61. data/lib/lutaml/uml/package.rb +0 -53
  62. data/lib/lutaml/uml/parsers/attribute.rb +0 -70
  63. data/lib/lutaml/uml/parsers/dsl.rb +0 -413
  64. data/lib/lutaml/uml/parsers/dsl_preprocessor.rb +0 -59
  65. data/lib/lutaml/uml/parsers/dsl_transform.rb +0 -27
  66. data/lib/lutaml/uml/parsers/yaml.rb +0 -46
  67. data/lib/lutaml/uml/port.rb +0 -8
  68. data/lib/lutaml/uml/primitive_type.rb +0 -14
  69. data/lib/lutaml/uml/property.rb +0 -27
  70. data/lib/lutaml/uml/pseudostate.rb +0 -11
  71. data/lib/lutaml/uml/realization.rb +0 -11
  72. data/lib/lutaml/uml/region.rb +0 -12
  73. data/lib/lutaml/uml/serializers/association.rb +0 -58
  74. data/lib/lutaml/uml/serializers/base.rb +0 -16
  75. data/lib/lutaml/uml/serializers/class.rb +0 -29
  76. data/lib/lutaml/uml/serializers/top_element_attribute.rb +0 -14
  77. data/lib/lutaml/uml/serializers/yaml_view.rb +0 -18
  78. data/lib/lutaml/uml/state.rb +0 -12
  79. data/lib/lutaml/uml/state_machine.rb +0 -12
  80. data/lib/lutaml/uml/top_element.rb +0 -58
  81. data/lib/lutaml/uml/top_element_attribute.rb +0 -38
  82. data/lib/lutaml/uml/transition.rb +0 -12
  83. data/lib/lutaml/uml/trigger.rb +0 -12
  84. data/lib/lutaml/uml/value.rb +0 -30
  85. data/lib/lutaml/uml/version.rb +0 -7
  86. data/lib/lutaml/uml/vertex.rb +0 -11
  87. data/lib/lutaml/uml.rb +0 -13
  88. data/spec/fixtures/datamodel/models/AddressClassProfile.yml +0 -90
  89. data/spec/fixtures/datamodel/models/AddressComponentProfile.yml +0 -63
  90. data/spec/fixtures/datamodel/models/AddressComponentSpecification.yml +0 -15
  91. data/spec/fixtures/datamodel/models/AddressProfile.yml +0 -36
  92. data/spec/fixtures/datamodel/models/AttributeProfile.yml +0 -32
  93. data/spec/fixtures/datamodel/models/InterchangeAddressClassProfile.yml +0 -79
  94. data/spec/fixtures/datamodel/models/Localization copy.yml +0 -23
  95. data/spec/fixtures/datamodel/models/Localization.yml +0 -23
  96. data/spec/fixtures/datamodel/models/ProfileCompliantAddress.yml +0 -36
  97. data/spec/fixtures/datamodel/models/ProfileCompliantAddressComponent.yml +0 -15
  98. data/spec/fixtures/datamodel/models/Signature.yml +0 -20
  99. data/spec/fixtures/datamodel/models/SignatureBlankDefinition.yml +0 -20
  100. data/spec/fixtures/datamodel/models/TextDirectionCode copy.yml +0 -16
  101. data/spec/fixtures/datamodel/models/TextDirectionCode.yml +0 -16
  102. data/spec/fixtures/datamodel/models/Validity.yml +0 -14
  103. data/spec/fixtures/datamodel/models/iso19160-1/Address.yml +0 -22
  104. data/spec/fixtures/datamodel/models/iso19160-1/AddressComponent.yml +0 -2
  105. data/spec/fixtures/datamodel/style.uml.inc +0 -37
  106. data/spec/fixtures/datamodel/views/AddressClassProfile.yml +0 -12
  107. data/spec/fixtures/datamodel/views/AddressProfile.yml +0 -3
  108. data/spec/fixtures/datamodel/views/CommonModels.yml +0 -9
  109. data/spec/fixtures/datamodel/views/TopDown.yml +0 -62
  110. data/spec/fixtures/dsl/broken_diagram.lutaml +0 -34
  111. data/spec/fixtures/dsl/diagram.lutaml +0 -3
  112. data/spec/fixtures/dsl/diagram_attributes.lutaml +0 -6
  113. data/spec/fixtures/dsl/diagram_blank_definion.lutaml +0 -6
  114. data/spec/fixtures/dsl/diagram_blank_entities.lutaml +0 -8
  115. data/spec/fixtures/dsl/diagram_class_assocation.lutaml +0 -29
  116. data/spec/fixtures/dsl/diagram_class_fields.lutaml +0 -25
  117. data/spec/fixtures/dsl/diagram_commented_includes.lutaml +0 -5
  118. data/spec/fixtures/dsl/diagram_comments.lutaml +0 -28
  119. data/spec/fixtures/dsl/diagram_concept_model.lutaml +0 -132
  120. data/spec/fixtures/dsl/diagram_data_types.lutaml +0 -44
  121. data/spec/fixtures/dsl/diagram_definitions.lutaml +0 -25
  122. data/spec/fixtures/dsl/diagram_includes.lutaml +0 -6
  123. data/spec/fixtures/dsl/diagram_multiply_classes.lutaml +0 -7
  124. data/spec/fixtures/dsl/diagram_non_existing_include.lutaml +0 -6
  125. data/spec/fixtures/dsl/shared.lutaml +0 -3
  126. data/spec/fixtures/dsl/shared1.lutaml +0 -4
  127. data/spec/fixtures/generated_dot/AddressClassProfile.dot +0 -170
  128. data/spec/fixtures/generated_dot/AddressProfile.dot +0 -34
  129. data/spec/lutaml/layout/graph_viz_engine_spec.rb +0 -31
  130. data/spec/lutaml/uml/formatter/graphviz_spec.rb +0 -41
  131. data/spec/lutaml/uml/parsers/dsl_spec.rb +0 -345
  132. data/spec/lutaml/uml/parsers/yaml_spec.rb +0 -18
  133. data/spec/lutaml/uml/serializers/yaml_view_spec.rb +0 -20
  134. data/spec/lutaml/uml_spec.rb +0 -7
  135. data/spec/spec_helper.rb +0 -25
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/uml/node/base"
4
- require "lutaml/uml/node/has_name"
5
- require "lutaml/uml/node/has_type"
6
-
7
- module Lutaml
8
- module Uml
9
- module Node
10
- class Field < Base
11
- include HasName
12
- include HasType
13
-
14
- def initialize(attributes = {})
15
- @access = "public"
16
-
17
- super
18
- end
19
-
20
- attr_reader :static
21
-
22
- def static=(value)
23
- @static = !!value
24
- end
25
-
26
- attr_reader :access
27
-
28
- def access=(value)
29
- @access = value.to_s # TODO: Validate?
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lutaml
4
- module Uml
5
- module Node
6
- module HasName
7
- attr_reader :name
8
-
9
- def name=(value)
10
- @name = value.to_s
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lutaml
4
- module Uml
5
- module Node
6
- module HasType
7
- attr_reader :type
8
-
9
- def type=(value)
10
- @type = value.to_s
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/uml/node/field"
4
- require "lutaml/uml/node/method_argument"
5
- require "lutaml/uml/node/has_name"
6
-
7
- module Lutaml
8
- module Uml
9
- module Node
10
- class Method < Field
11
- include HasName
12
-
13
- attr_reader :abstract
14
-
15
- def abstract=(value)
16
- @abstract = !!value
17
- end
18
-
19
- attr_reader :arguments
20
-
21
- def arguments=(value)
22
- @arguments = value.to_a.map do |attributes|
23
- MethodArgument.new(attributes)
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/uml/node/base"
4
- require "lutaml/uml/node/has_name"
5
- require "lutaml/uml/node/has_type"
6
-
7
- module Lutaml
8
- module Uml
9
- module Node
10
- class MethodArgument < Base
11
- include HasName
12
- include HasType
13
- end
14
- end
15
- end
16
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "lutaml/uml/node/base"
4
- require "lutaml/uml/node/has_name"
5
- require "lutaml/uml/node/has_type"
6
-
7
- module Lutaml
8
- module Uml
9
- module Node
10
- class Relationship < Base
11
- include HasName
12
- include HasType
13
-
14
- attr_reader :from
15
-
16
- def from=(value)
17
- @from = value.to_s
18
- end
19
-
20
- attr_reader :to
21
-
22
- def to=(value)
23
- @to = value.to_s
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- ## Behaviour metamodel
5
- ##
6
- module Lutaml
7
- module Uml
8
- class OpaqueBehavior < Behavior
9
- end
10
- end
11
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lutaml
4
- module Uml
5
- class Operation
6
- include HasAttributes
7
- include HasMembers
8
-
9
- attr_accessor :definition,
10
- :name,
11
- :return_type,
12
- :parameter_type
13
-
14
- # rubocop:disable Rails/ActiveRecordAliases
15
- def initialize(attributes = {})
16
- update_attributes(attributes)
17
- end
18
- # rubocop:enable Rails/ActiveRecordAliases
19
-
20
- def definition=(value)
21
- @definition = value
22
- .to_s
23
- .gsub(/\\}/, '}')
24
- .gsub(/\\{/, '{')
25
- .split("\n")
26
- .map(&:strip)
27
- .join("\n")
28
- end
29
- end
30
- end
31
- end
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lutaml
4
- module Uml
5
- class Package < TopElement
6
- include HasAttributes
7
-
8
- attr_accessor :imports, :contents
9
- attr_reader :classes, :enums, :data_types, :children_packages
10
-
11
- def initialize(attributes)
12
- update_attributes(attributes)
13
- @children_packages ||= packages.map { |pkg| [pkg, pkg.packages, pkg.packages.map(&:children_packages)] }.flatten.uniq
14
- end
15
-
16
- def classes=(value)
17
- @classes = value.to_a.map { |attributes| Class.new(attributes) }
18
- end
19
-
20
- def enums=(value)
21
- @enums = value.to_a.map { |attributes| Enum.new(attributes) }
22
- end
23
-
24
- def data_types=(value)
25
- @data_types = value.to_a.map { |attributes| DataType.new(attributes) }
26
- end
27
-
28
- def packages=(value)
29
- @packages = value.to_a.map { |attributes| Package.new(attributes) }
30
- end
31
-
32
- def diagrams=(value)
33
- @diagrams = value.to_a.map { |attributes| Diagram.new(attributes) }
34
- end
35
-
36
- def classes
37
- @classes || []
38
- end
39
-
40
- def enums
41
- @enums || []
42
- end
43
-
44
- def packages
45
- @packages || []
46
- end
47
-
48
- def diagrams
49
- @diagrams || []
50
- end
51
- end
52
- end
53
- end
@@ -1,70 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "parslet"
4
-
5
- module Lutaml
6
- module Uml
7
- module Parsers
8
- class Attribute < Parslet::Parser
9
- class Transform < Parslet::Transform
10
- rule(integer: simple(:x)) { Integer(x) }
11
- rule(float: simple(:x)) { Float(x) }
12
- rule(string: simple(:x)) { String(x) }
13
- end
14
-
15
- def self.parse(io, options = {})
16
- new.parse(io, options)
17
- end
18
-
19
- def parse(io, options = {})
20
- tree = Transform.new.apply(super)
21
- tree = tree[:assignments].each_with_object({}) do |assignment, memo|
22
- memo[assignment[:name].to_s] = assignment[:value]
23
- end
24
-
25
- tree
26
- end
27
-
28
- rule(:spaces) { match("\s").repeat(1) }
29
- rule(:spaces?) { spaces.maybe }
30
-
31
- rule(:digits) { match["0-9"].repeat(1) }
32
-
33
- rule(:integer) do
34
- (str("-").maybe >> digits >> str(".").absent?).as(:integer)
35
- end
36
- rule(:float) do
37
- (str("-").maybe >> digits >> str(".") >> digits).as(:float)
38
- end
39
-
40
- rule(:string_single_quoted) do
41
- str("'") >>
42
- (str("'").absent? >> any).repeat.as(:string) >>
43
- str("'")
44
- end
45
- rule(:string_double_quoted) do
46
- str('"') >>
47
- (str('"').absent? >> any).repeat.as(:string) >>
48
- str('"')
49
- end
50
-
51
- rule(:string) { string_single_quoted | string_double_quoted }
52
-
53
- rule(:assignment_name) do
54
- (match["=\s"].absent? >> any).repeat.as(:name)
55
- end
56
- rule(:assignment_value) { (integer | float | string).as(:value) }
57
- rule(:assignment) do
58
- assignment_name >> spaces? >> str("=") >> spaces? >> assignment_value
59
- end
60
-
61
- rule(:attribute) { spaces? >> assignment >> spaces? }
62
- rule(:attributes) do
63
- (attribute >> (str(",") >> attribute).repeat).repeat.as(:assignments)
64
- end
65
-
66
- root(:attributes)
67
- end
68
- end
69
- end
70
- end