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.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +22 -0
- data/Gemfile +1 -5
- data/README.adoc +4 -42
- data/Rakefile +0 -5
- data/lutaml-uml.gemspec +23 -38
- metadata +20 -292
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -40
- data/.github/workflows/windows.yml +0 -51
- data/.gitignore +0 -12
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/CODE_OF_CONDUCT.md +0 -74
- data/LUTAML.adoc +0 -372
- data/bin/console +0 -15
- data/bin/folder_yaml2lutaml.sh +0 -6
- data/bin/plantuml2lutaml +0 -59
- data/bin/setup +0 -8
- data/bin/yaml2lutaml +0 -144
- data/exe/lutaml-wsd2uml +0 -59
- data/exe/lutaml-yaml2uml +0 -144
- data/lib/lutaml/layout/engine.rb +0 -15
- data/lib/lutaml/layout/graph_viz_engine.rb +0 -19
- data/lib/lutaml/uml/abstraction.rb +0 -11
- data/lib/lutaml/uml/activity.rb +0 -11
- data/lib/lutaml/uml/actor.rb +0 -19
- data/lib/lutaml/uml/association.rb +0 -43
- data/lib/lutaml/uml/behavior.rb +0 -11
- data/lib/lutaml/uml/class.rb +0 -83
- data/lib/lutaml/uml/classifier.rb +0 -11
- data/lib/lutaml/uml/connector.rb +0 -21
- data/lib/lutaml/uml/constraint.rb +0 -12
- data/lib/lutaml/uml/constructor_end.rb +0 -16
- data/lib/lutaml/uml/data_type.rb +0 -75
- data/lib/lutaml/uml/dependency.rb +0 -21
- data/lib/lutaml/uml/diagram.rb +0 -8
- data/lib/lutaml/uml/document.rb +0 -81
- data/lib/lutaml/uml/enum.rb +0 -45
- data/lib/lutaml/uml/event.rb +0 -12
- data/lib/lutaml/uml/final_state.rb +0 -11
- data/lib/lutaml/uml/formatter/base.rb +0 -67
- data/lib/lutaml/uml/formatter/graphviz.rb +0 -334
- data/lib/lutaml/uml/formatter.rb +0 -21
- data/lib/lutaml/uml/has_attributes.rb +0 -14
- data/lib/lutaml/uml/has_members.rb +0 -30
- data/lib/lutaml/uml/instance.rb +0 -17
- data/lib/lutaml/uml/model.rb +0 -13
- data/lib/lutaml/uml/node/base.rb +0 -21
- data/lib/lutaml/uml/node/class_node.rb +0 -57
- data/lib/lutaml/uml/node/class_relationship.rb +0 -14
- data/lib/lutaml/uml/node/document.rb +0 -18
- data/lib/lutaml/uml/node/field.rb +0 -34
- data/lib/lutaml/uml/node/has_name.rb +0 -15
- data/lib/lutaml/uml/node/has_type.rb +0 -15
- data/lib/lutaml/uml/node/method.rb +0 -29
- data/lib/lutaml/uml/node/method_argument.rb +0 -16
- data/lib/lutaml/uml/node/relationship.rb +0 -28
- data/lib/lutaml/uml/opaque_behavior.rb +0 -11
- data/lib/lutaml/uml/operation.rb +0 -31
- data/lib/lutaml/uml/package.rb +0 -53
- data/lib/lutaml/uml/parsers/attribute.rb +0 -70
- data/lib/lutaml/uml/parsers/dsl.rb +0 -413
- data/lib/lutaml/uml/parsers/dsl_preprocessor.rb +0 -59
- data/lib/lutaml/uml/parsers/dsl_transform.rb +0 -27
- data/lib/lutaml/uml/parsers/yaml.rb +0 -46
- data/lib/lutaml/uml/port.rb +0 -8
- data/lib/lutaml/uml/primitive_type.rb +0 -14
- data/lib/lutaml/uml/property.rb +0 -27
- data/lib/lutaml/uml/pseudostate.rb +0 -11
- data/lib/lutaml/uml/realization.rb +0 -11
- data/lib/lutaml/uml/region.rb +0 -12
- data/lib/lutaml/uml/serializers/association.rb +0 -58
- data/lib/lutaml/uml/serializers/base.rb +0 -16
- data/lib/lutaml/uml/serializers/class.rb +0 -29
- data/lib/lutaml/uml/serializers/top_element_attribute.rb +0 -14
- data/lib/lutaml/uml/serializers/yaml_view.rb +0 -18
- data/lib/lutaml/uml/state.rb +0 -12
- data/lib/lutaml/uml/state_machine.rb +0 -12
- data/lib/lutaml/uml/top_element.rb +0 -58
- data/lib/lutaml/uml/top_element_attribute.rb +0 -38
- data/lib/lutaml/uml/transition.rb +0 -12
- data/lib/lutaml/uml/trigger.rb +0 -12
- data/lib/lutaml/uml/value.rb +0 -30
- data/lib/lutaml/uml/version.rb +0 -7
- data/lib/lutaml/uml/vertex.rb +0 -11
- data/lib/lutaml/uml.rb +0 -13
- data/spec/fixtures/datamodel/models/AddressClassProfile.yml +0 -90
- data/spec/fixtures/datamodel/models/AddressComponentProfile.yml +0 -63
- data/spec/fixtures/datamodel/models/AddressComponentSpecification.yml +0 -15
- data/spec/fixtures/datamodel/models/AddressProfile.yml +0 -36
- data/spec/fixtures/datamodel/models/AttributeProfile.yml +0 -32
- data/spec/fixtures/datamodel/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/fixtures/datamodel/models/Localization copy.yml +0 -23
- data/spec/fixtures/datamodel/models/Localization.yml +0 -23
- data/spec/fixtures/datamodel/models/ProfileCompliantAddress.yml +0 -36
- data/spec/fixtures/datamodel/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/fixtures/datamodel/models/Signature.yml +0 -20
- data/spec/fixtures/datamodel/models/SignatureBlankDefinition.yml +0 -20
- data/spec/fixtures/datamodel/models/TextDirectionCode copy.yml +0 -16
- data/spec/fixtures/datamodel/models/TextDirectionCode.yml +0 -16
- data/spec/fixtures/datamodel/models/Validity.yml +0 -14
- data/spec/fixtures/datamodel/models/iso19160-1/Address.yml +0 -22
- data/spec/fixtures/datamodel/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/fixtures/datamodel/style.uml.inc +0 -37
- data/spec/fixtures/datamodel/views/AddressClassProfile.yml +0 -12
- data/spec/fixtures/datamodel/views/AddressProfile.yml +0 -3
- data/spec/fixtures/datamodel/views/CommonModels.yml +0 -9
- data/spec/fixtures/datamodel/views/TopDown.yml +0 -62
- data/spec/fixtures/dsl/broken_diagram.lutaml +0 -34
- data/spec/fixtures/dsl/diagram.lutaml +0 -3
- data/spec/fixtures/dsl/diagram_attributes.lutaml +0 -6
- data/spec/fixtures/dsl/diagram_blank_definion.lutaml +0 -6
- data/spec/fixtures/dsl/diagram_blank_entities.lutaml +0 -8
- data/spec/fixtures/dsl/diagram_class_assocation.lutaml +0 -29
- data/spec/fixtures/dsl/diagram_class_fields.lutaml +0 -25
- data/spec/fixtures/dsl/diagram_commented_includes.lutaml +0 -5
- data/spec/fixtures/dsl/diagram_comments.lutaml +0 -28
- data/spec/fixtures/dsl/diagram_concept_model.lutaml +0 -132
- data/spec/fixtures/dsl/diagram_data_types.lutaml +0 -44
- data/spec/fixtures/dsl/diagram_definitions.lutaml +0 -25
- data/spec/fixtures/dsl/diagram_includes.lutaml +0 -6
- data/spec/fixtures/dsl/diagram_multiply_classes.lutaml +0 -7
- data/spec/fixtures/dsl/diagram_non_existing_include.lutaml +0 -6
- data/spec/fixtures/dsl/shared.lutaml +0 -3
- data/spec/fixtures/dsl/shared1.lutaml +0 -4
- data/spec/fixtures/generated_dot/AddressClassProfile.dot +0 -170
- data/spec/fixtures/generated_dot/AddressProfile.dot +0 -34
- data/spec/lutaml/layout/graph_viz_engine_spec.rb +0 -31
- data/spec/lutaml/uml/formatter/graphviz_spec.rb +0 -41
- data/spec/lutaml/uml/parsers/dsl_spec.rb +0 -345
- data/spec/lutaml/uml/parsers/yaml_spec.rb +0 -18
- data/spec/lutaml/uml/serializers/yaml_view_spec.rb +0 -20
- data/spec/lutaml/uml_spec.rb +0 -7
- 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,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
|
data/lib/lutaml/uml/operation.rb
DELETED
@@ -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
|
data/lib/lutaml/uml/package.rb
DELETED
@@ -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
|