lutaml 0.9.40 → 0.9.42
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/README.adoc +7 -1
- data/docs/lutaml-express.adoc +35 -0
- data/docs/lutaml-sysml.adoc +10 -0
- data/docs/lutaml-uml.adoc +111 -0
- data/docs/lutaml-xmi.adoc +33 -0
- data/exe/lutaml-yaml2uml +1 -1
- data/lib/lutaml/converter/xmi_to_uml.rb +440 -0
- data/lib/lutaml/express.rb +0 -1
- data/lib/lutaml/sysml/allocate.rb +1 -1
- data/lib/lutaml/sysml/allocated.rb +1 -1
- data/lib/lutaml/sysml/binding_connector.rb +1 -1
- data/lib/lutaml/sysml/block.rb +1 -1
- data/lib/lutaml/sysml/constraint_block.rb +1 -1
- data/lib/lutaml/sysml/copy.rb +1 -1
- data/lib/lutaml/sysml/derive_requirement.rb +1 -1
- data/lib/lutaml/sysml/nested_connector_end.rb +1 -1
- data/lib/lutaml/sysml/refine.rb +1 -1
- data/lib/lutaml/sysml/requirement_related.rb +1 -1
- data/lib/lutaml/sysml/satisfy.rb +1 -1
- data/lib/lutaml/sysml/test_case.rb +1 -1
- data/lib/lutaml/sysml/trace.rb +1 -1
- data/lib/lutaml/sysml/verify.rb +1 -1
- data/lib/lutaml/sysml/xmi_file.rb +1 -1
- data/lib/lutaml/sysml.rb +0 -1
- data/lib/lutaml/uml/association_generalization.rb +17 -0
- data/lib/lutaml/uml/class.rb +2 -3
- data/lib/lutaml/uml/classifier.rb +4 -2
- data/lib/lutaml/uml/diagram.rb +7 -0
- data/lib/lutaml/uml/general_attribute.rb +22 -0
- data/lib/lutaml/uml/generalization.rb +35 -0
- data/lib/lutaml/uml/top_element_attribute.rb +4 -0
- data/lib/lutaml/uml.rb +3 -0
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xmi/parsers/xmi_base.rb +13 -1
- data/lib/lutaml/xmi/parsers/xml.rb +3 -4
- metadata +11 -10
- data/docs/UML_README.adoc +0 -44
- data/lib/lutaml/converter/xmi_hash_to_uml.rb +0 -196
- data/lib/lutaml/express/README.adoc +0 -55
- data/lib/lutaml/express/version.rb +0 -7
- data/lib/lutaml/sysml/README.md +0 -40
- data/lib/lutaml/sysml/version.rb +0 -5
- data/lib/lutaml/xmi/README.adoc +0 -24
- /data/{LUTAML.adoc → docs/lutaml_syntax.adoc} +0 -0
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
module Lutaml
|
|
2
|
-
module Converter
|
|
3
|
-
module XmiHashToUml
|
|
4
|
-
def create_uml_document(hash)
|
|
5
|
-
::Lutaml::Uml::Document.new.tap do |doc|
|
|
6
|
-
doc.name = hash[:name]
|
|
7
|
-
hash[:packages]&.each do |package_hash|
|
|
8
|
-
pkg = create_uml_package(package_hash)
|
|
9
|
-
doc.packages = [] if doc.packages.nil?
|
|
10
|
-
doc.packages << pkg
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def create_uml_package(hash) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
16
|
-
package = ::Lutaml::Uml::Package.new
|
|
17
|
-
package.xmi_id = hash[:xmi_id]
|
|
18
|
-
package.name = hash[:name]
|
|
19
|
-
package.definition = hash[:definition]
|
|
20
|
-
package.stereotype = hash[:stereotype]
|
|
21
|
-
|
|
22
|
-
hash[:classes]&.each do |class_hash|
|
|
23
|
-
class_obj = create_uml_class(class_hash)
|
|
24
|
-
package.classes = [] if package.classes.nil?
|
|
25
|
-
package.classes << class_obj
|
|
26
|
-
end
|
|
27
|
-
hash[:enums]&.each do |enum_hash|
|
|
28
|
-
enum_obj = create_uml_enum(enum_hash)
|
|
29
|
-
package.enums = [] if package.enums.nil?
|
|
30
|
-
package.enums << enum_obj
|
|
31
|
-
end
|
|
32
|
-
hash[:data_types]&.each do |data_type_hash|
|
|
33
|
-
data_type_obj = create_uml_data_type(data_type_hash)
|
|
34
|
-
package.data_types = [] if package.data_types.nil?
|
|
35
|
-
package.data_types << data_type_obj
|
|
36
|
-
end
|
|
37
|
-
hash[:diagrams]&.each do |diagram_hash|
|
|
38
|
-
diagram_obj = create_uml_diagram(diagram_hash)
|
|
39
|
-
package.diagrams = [] if package.diagrams.nil?
|
|
40
|
-
package.diagrams << diagram_obj
|
|
41
|
-
end
|
|
42
|
-
hash[:packages]&.each do |package_hash|
|
|
43
|
-
pkg = create_uml_package(package_hash)
|
|
44
|
-
package.packages = [] if package.packages.nil?
|
|
45
|
-
package.packages << pkg
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
package
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def create_uml_class(hash) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
52
|
-
::Lutaml::Uml::Class.new.tap do |klass| # rubocop:disable Metrics/BlockLength
|
|
53
|
-
klass.xmi_id = hash[:xmi_id]
|
|
54
|
-
klass.name = hash[:name]
|
|
55
|
-
klass.type = hash[:type]
|
|
56
|
-
klass.is_abstract = hash[:is_abstract]
|
|
57
|
-
klass.definition = hash[:definition]
|
|
58
|
-
klass.stereotype = hash[:stereotype]
|
|
59
|
-
hash[:attributes]&.each do |attr_hash|
|
|
60
|
-
attr = create_uml_attribute(attr_hash)
|
|
61
|
-
klass.attributes = [] if klass.attributes.nil?
|
|
62
|
-
klass.attributes << attr
|
|
63
|
-
end
|
|
64
|
-
hash[:associations]&.each do |assoc_hash|
|
|
65
|
-
assoc = create_uml_association(assoc_hash)
|
|
66
|
-
klass.associations = [] if klass.associations.nil?
|
|
67
|
-
klass.associations << assoc
|
|
68
|
-
end
|
|
69
|
-
hash[:operations]&.each do |op_hash|
|
|
70
|
-
op = create_uml_operation(op_hash)
|
|
71
|
-
klass.operations = [] if klass.operations.nil?
|
|
72
|
-
klass.operations << op
|
|
73
|
-
end
|
|
74
|
-
hash[:constraints]&.each do |constraint_hash|
|
|
75
|
-
constraint = create_uml_constraint(constraint_hash)
|
|
76
|
-
klass.constraints = [] if klass.constraints
|
|
77
|
-
klass.constraints << constraint
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def create_uml_enum(hash) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
|
83
|
-
::Lutaml::Uml::Enum.new.tap do |enum|
|
|
84
|
-
enum.xmi_id = hash[:xmi_id]
|
|
85
|
-
enum.name = hash[:name]
|
|
86
|
-
hash[:values]&.each do |value_hash|
|
|
87
|
-
value = create_uml_value(value_hash)
|
|
88
|
-
enum.values = [] if enum.values.nil?
|
|
89
|
-
enum.values << value
|
|
90
|
-
end
|
|
91
|
-
enum.definition = hash[:definition]
|
|
92
|
-
enum.stereotype = hash[:stereotype]
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
def create_uml_data_type(hash) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
|
97
|
-
::Lutaml::Uml::DataType.new.tap do |data_type|
|
|
98
|
-
data_type.xmi_id = hash[:xmi_id]
|
|
99
|
-
data_type.name = hash[:name]
|
|
100
|
-
data_type.is_abstract = hash[:is_abstract]
|
|
101
|
-
data_type.definition = hash[:definition]
|
|
102
|
-
data_type.stereotype = hash[:stereotype]
|
|
103
|
-
hash[:attributes]&.each do |attr_hash|
|
|
104
|
-
attr = create_uml_attribute(attr_hash)
|
|
105
|
-
data_type.attributes = [] if data_type.attributes.nil?
|
|
106
|
-
data_type.attributes << attr
|
|
107
|
-
end
|
|
108
|
-
hash[:operations]&.each do |op_hash|
|
|
109
|
-
op = create_uml_operation(op_hash)
|
|
110
|
-
data_type.operations = [] if data_type.operations.nil?
|
|
111
|
-
data_type.operations << op
|
|
112
|
-
end
|
|
113
|
-
hash[:associations]&.each do |assoc_hash|
|
|
114
|
-
assoc = create_uml_association(assoc_hash)
|
|
115
|
-
data_type.associations = [] if data_type.associations.nil?
|
|
116
|
-
data_type.associations << assoc
|
|
117
|
-
end
|
|
118
|
-
hash[:constraints]&.each do |constraint_hash|
|
|
119
|
-
constraint = create_uml_constraint(constraint_hash)
|
|
120
|
-
data_type.constraints = [] if data_type.constraints
|
|
121
|
-
data_type.constraints << constraint
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def create_uml_diagram(hash)
|
|
127
|
-
::Lutaml::Uml::Diagram.new.tap do |diagram|
|
|
128
|
-
diagram.xmi_id = hash[:xmi_id]
|
|
129
|
-
diagram.name = hash[:name]
|
|
130
|
-
diagram.definition = hash[:definition]
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
def create_uml_attribute(hash) # rubocop:disable Metrics/AbcSize
|
|
135
|
-
::Lutaml::Uml::TopElementAttribute.new.tap do |attr|
|
|
136
|
-
attr.id = hash[:id]
|
|
137
|
-
attr.name = hash[:name]
|
|
138
|
-
attr.type = hash[:type]
|
|
139
|
-
attr.xmi_id = hash[:xmi_id]
|
|
140
|
-
attr.is_derived = hash[:is_derived]
|
|
141
|
-
attr.cardinality = create_uml_cardinality(hash[:cardinality])
|
|
142
|
-
attr.definition = hash[:definition]
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
def create_uml_cardinality(hash)
|
|
147
|
-
::Lutaml::Uml::Cardinality.new.tap do |cardinality|
|
|
148
|
-
cardinality.min = hash[:min]
|
|
149
|
-
cardinality.max = hash[:max]
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
def create_uml_association(hash) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
154
|
-
::Lutaml::Uml::Association.new.tap do |assoc|
|
|
155
|
-
assoc.xmi_id = hash[:xmi_id]
|
|
156
|
-
assoc.member_end = hash[:member_end]
|
|
157
|
-
assoc.member_end_type = hash[:member_end_type]
|
|
158
|
-
assoc.member_end_cardinality = create_uml_cardinality(
|
|
159
|
-
hash[:member_end_cardinality],
|
|
160
|
-
)
|
|
161
|
-
assoc.member_end_attribute_name = hash[:member_end_attribute_name]
|
|
162
|
-
assoc.member_end_xmi_id = hash[:member_end_xmi_id]
|
|
163
|
-
assoc.owner_end = hash[:owner_end]
|
|
164
|
-
assoc.owner_end_xmi_id = hash[:owner_end_xmi_id]
|
|
165
|
-
assoc.definition = hash[:definition]
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
def create_uml_operation(hash)
|
|
170
|
-
::Lutaml::Uml::Operation.new.tap do |op|
|
|
171
|
-
op.id = hash[:id]
|
|
172
|
-
op.xmi_id = hash[:xmi_id]
|
|
173
|
-
op.name = hash[:name]
|
|
174
|
-
op.definition = hash[:definition]
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
def create_uml_constraint(hash)
|
|
179
|
-
::Lutaml::Uml::Constraint.new.tap do |constraint|
|
|
180
|
-
constraint.name = hash[:name]
|
|
181
|
-
constraint.type = hash[:type]
|
|
182
|
-
constraint.weight = hash[:weight]
|
|
183
|
-
constraint.status = hash[:status]
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
def create_uml_value(hash)
|
|
188
|
-
::Lutaml::Uml::Value.new.tap do |value|
|
|
189
|
-
value.name = hash[:name]
|
|
190
|
-
value.type = hash[:type]
|
|
191
|
-
value.definition = hash[:definition]
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
end
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
image:https://img.shields.io/gem/v/lutaml-express.svg["Gem Version", link="https://rubygems.org/gems/lutaml-express"]
|
|
2
|
-
// image:https://codeclimate.com/github/lutaml/lutaml-express/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/lutaml/lutaml-express"]
|
|
3
|
-
image:https://github.com/lutaml/lutaml-express/workflows/rake/badge.svg["Build Status", link="https://github.com/lutaml/lutaml-express/actions?workflow=rake"]
|
|
4
|
-
|
|
5
|
-
= lutaml-express
|
|
6
|
-
|
|
7
|
-
== Functionality
|
|
8
|
-
|
|
9
|
-
Gem-extention for lutaml, works with EXPRESS files
|
|
10
|
-
|
|
11
|
-
=== Installation
|
|
12
|
-
|
|
13
|
-
With bundler:
|
|
14
|
-
|
|
15
|
-
[source,ruby]
|
|
16
|
-
----
|
|
17
|
-
# Gemfile
|
|
18
|
-
gem "lutaml-express"
|
|
19
|
-
----
|
|
20
|
-
|
|
21
|
-
Then in console:
|
|
22
|
-
|
|
23
|
-
[source,console]
|
|
24
|
-
----
|
|
25
|
-
$ bundle
|
|
26
|
-
----
|
|
27
|
-
|
|
28
|
-
With RubyGems:
|
|
29
|
-
|
|
30
|
-
[source,console]
|
|
31
|
-
----
|
|
32
|
-
$ gem install lutaml-express
|
|
33
|
-
----
|
|
34
|
-
|
|
35
|
-
=== Usage
|
|
36
|
-
|
|
37
|
-
[source,ruby]
|
|
38
|
-
----
|
|
39
|
-
Lutaml::Express::Parsers::Exp.parse(File.new('/path/to/file.exp')) # => Expressir::Model::Repository
|
|
40
|
-
----
|
|
41
|
-
|
|
42
|
-
== Development
|
|
43
|
-
|
|
44
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
45
|
-
|
|
46
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
47
|
-
|
|
48
|
-
## Contributing
|
|
49
|
-
|
|
50
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lutaml-express. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lutaml-express/blob/master/CODE_OF_CONDUCT.md).
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
== Code of Conduct
|
|
54
|
-
|
|
55
|
-
Everyone interacting in the Lutaml::Uml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lutaml-express/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/lutaml/sysml/README.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Lutaml::Sysml
|
|
2
|
-
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lutaml/sysml`. To experiment with that code, run `bin/console` for an interactive prompt.
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Add this line to your application's Gemfile:
|
|
10
|
-
|
|
11
|
-
```ruby
|
|
12
|
-
gem 'lutaml-sysml'
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
And then execute:
|
|
16
|
-
|
|
17
|
-
$ bundle install
|
|
18
|
-
|
|
19
|
-
Or install it yourself as:
|
|
20
|
-
|
|
21
|
-
$ gem install lutaml-sysml
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
TODO: Write usage instructions here
|
|
26
|
-
|
|
27
|
-
## Development
|
|
28
|
-
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
|
-
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
32
|
-
|
|
33
|
-
## Contributing
|
|
34
|
-
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lutaml-sysml. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lutaml-sysml/blob/master/CODE_OF_CONDUCT.md).
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## Code of Conduct
|
|
39
|
-
|
|
40
|
-
Everyone interacting in the Lutaml::Sysml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lutaml-sysml/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/lutaml/sysml/version.rb
DELETED
data/lib/lutaml/xmi/README.adoc
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Lutaml::Uml
|
|
2
|
-
|
|
3
|
-
Lutaml-xmi is a parser for XML Metadata Interchange (XMI) Specification files.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
### Bundler: `gem "lutaml-xmi"`
|
|
8
|
-
|
|
9
|
-
### RubyGems: `gem install lutaml-xmi`
|
|
10
|
-
|
|
11
|
-
## Development
|
|
12
|
-
|
|
13
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
14
|
-
|
|
15
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
16
|
-
|
|
17
|
-
## Contributing
|
|
18
|
-
|
|
19
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lutaml-xmi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lutaml-xmi/blob/master/CODE_OF_CONDUCT.md).
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Code of Conduct
|
|
23
|
-
|
|
24
|
-
Everyone interacting in the Lutaml::Uml project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lutaml-xmi/blob/master/CODE_OF_CONDUCT.md).
|
|
File without changes
|