rgen 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +95 -83
- data/Rakefile +4 -3
- data/lib/ea_support/ea_support.rb +54 -0
- data/lib/ea_support/id_store.rb +32 -0
- data/lib/ea_support/uml13_ea_metamodel.rb +562 -0
- data/lib/ea_support/uml13_ea_metamodel_ext.rb +45 -0
- data/lib/ea_support/uml13_ea_metamodel_generator.rb +43 -0
- data/lib/ea_support/uml13_ea_to_uml13.rb +72 -0
- data/lib/ea_support/uml13_to_uml13_ea.rb +82 -0
- data/lib/rgen/ecore/ecore.rb +16 -2
- data/lib/rgen/ecore/ecore_builder_methods.rb +81 -0
- data/lib/rgen/ecore/ecore_instantiator.rb +5 -1
- data/lib/rgen/metamodel_builder/builder_extensions.rb +11 -3
- data/lib/rgen/metamodel_builder/module_extension2.rb +205 -0
- data/lib/rgen/method_delegation.rb +99 -0
- data/lib/rgen/model_builder.rb +27 -0
- data/lib/rgen/model_builder/builder_context.rb +318 -0
- data/lib/rgen/model_builder/model_serializer.rb +201 -0
- data/lib/rgen/model_builder/reference_resolver.rb +156 -0
- data/lib/rgen/template_language/directory_template_container.rb +6 -2
- data/lib/rgen/template_language/output_handler.rb +2 -4
- data/lib/rgen/template_language/template_container.rb +212 -195
- data/lib/rgen/transformer.rb +95 -4
- data/lib/transformers/ecore_to_uml13.rb +66 -0
- data/lib/transformers/uml13_to_ecore.rb +16 -7
- data/test/ea_instantiator_test.rb +8 -14
- data/test/ea_serializer_test.rb +3 -9
- data/test/ea_serializer_test/ea_testmodel_regenerated.xml +2 -2
- data/test/ea_serializer_test/ea_testmodel_regenerated_import.log +3 -0
- data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +19 -19
- data/test/metamodel_roundtrip_test/houseMetamodel_Regenerated.ecore +44 -44
- data/test/method_delegation_test.rb +178 -0
- data/test/model_builder/builder_context_test.rb +59 -0
- data/test/model_builder/builder_test.rb +284 -0
- data/test/model_builder/ecore_internal.rb +103 -0
- data/test/model_builder/ecore_original.rb +163 -0
- data/test/model_builder/ecore_original_regenerated.rb +163 -0
- data/test/model_builder/reference_resolver_test.rb +156 -0
- data/test/model_builder/serializer_test.rb +63 -0
- data/test/model_builder_test.rb +4 -0
- data/test/rgen_test.rb +2 -0
- data/test/template_language_test.rb +41 -1
- data/test/template_language_test/expected_result1.txt +1 -3
- data/test/template_language_test/templates/define_local_test/local.tpl +8 -0
- data/test/template_language_test/templates/define_local_test/test.tpl +8 -0
- data/test/template_language_test/templates/evaluate_test/test.tpl +7 -0
- data/test/template_language_test/templates/no_indent_test/no_indent.tpl +3 -0
- data/test/template_language_test/templates/no_indent_test/sub1/no_indent.tpl +3 -0
- data/test/template_language_test/templates/no_indent_test/test.tpl +24 -0
- data/test/template_language_test/templates/no_indent_test/test2.tpl +13 -0
- data/test/template_language_test/templates/no_indent_test/test3.tpl +10 -0
- data/test/template_language_test/templates/template_resolution_test/sub1.tpl +9 -0
- data/test/template_language_test/templates/template_resolution_test/sub1/sub1.tpl +3 -0
- data/test/template_language_test/templates/template_resolution_test/test.tpl +4 -0
- data/test/template_language_test/testout.txt +1 -3
- data/test/testmodel/ea_testmodel_import.log +1 -0
- data/test/testmodel/ea_testmodel_regenerated.xml +808 -0
- data/test/transformer_test.rb +3 -5
- metadata +52 -3
- data/lib/instantiators/ea_instantiator.rb +0 -39
data/test/transformer_test.rb
CHANGED
@@ -6,7 +6,6 @@ require 'rgen/transformer'
|
|
6
6
|
require 'rgen/environment'
|
7
7
|
require 'rgen/model_comparator'
|
8
8
|
require 'metamodels/uml13_metamodel'
|
9
|
-
require 'instantiators/ea_instantiator'
|
10
9
|
require 'testmodel/class_model_checker'
|
11
10
|
|
12
11
|
class TransformerTest < Test::Unit::TestCase
|
@@ -242,10 +241,9 @@ class TransformerTest < Test::Unit::TestCase
|
|
242
241
|
def test_copyTransformer
|
243
242
|
envIn = RGen::Environment.new
|
244
243
|
envOut = RGen::Environment.new
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
}
|
244
|
+
|
245
|
+
EASupport.instantiateUML13FromXMI11(envIn, MODEL_DIR+"/ea_testmodel.xml")
|
246
|
+
|
249
247
|
CopyTransformer.new(envIn, envOut).transform
|
250
248
|
checkClassModel(envOut)
|
251
249
|
assert modelEqual?(
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Thiede
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-08 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -24,8 +24,15 @@ extra_rdoc_files:
|
|
24
24
|
- CHANGELOG
|
25
25
|
- MIT-LICENSE
|
26
26
|
files:
|
27
|
+
- lib/ea_support
|
28
|
+
- lib/ea_support/ea_support.rb
|
29
|
+
- lib/ea_support/id_store.rb
|
30
|
+
- lib/ea_support/uml13_ea_metamodel.rb
|
31
|
+
- lib/ea_support/uml13_ea_metamodel_ext.rb
|
32
|
+
- lib/ea_support/uml13_ea_metamodel_generator.rb
|
33
|
+
- lib/ea_support/uml13_ea_to_uml13.rb
|
34
|
+
- lib/ea_support/uml13_to_uml13_ea.rb
|
27
35
|
- lib/instantiators
|
28
|
-
- lib/instantiators/ea_instantiator.rb
|
29
36
|
- lib/metamodels
|
30
37
|
- lib/metamodels/uml13_metamodel.rb
|
31
38
|
- lib/metamodels/uml13_metamodel_ext.rb
|
@@ -42,6 +49,7 @@ files:
|
|
42
49
|
- lib/rgen/auto_class_creator.rb
|
43
50
|
- lib/rgen/ecore
|
44
51
|
- lib/rgen/ecore/ecore.rb
|
52
|
+
- lib/rgen/ecore/ecore_builder_methods.rb
|
45
53
|
- lib/rgen/ecore/ecore_ext.rb
|
46
54
|
- lib/rgen/ecore/ecore_instantiator.rb
|
47
55
|
- lib/rgen/ecore/ecore_transformer.rb
|
@@ -62,7 +70,14 @@ files:
|
|
62
70
|
- lib/rgen/metamodel_builder/metamodel_description.rb
|
63
71
|
- lib/rgen/metamodel_builder/mm_multiple.rb
|
64
72
|
- lib/rgen/metamodel_builder/module_extension.rb
|
73
|
+
- lib/rgen/metamodel_builder/module_extension2.rb
|
65
74
|
- lib/rgen/metamodel_builder.rb
|
75
|
+
- lib/rgen/method_delegation.rb
|
76
|
+
- lib/rgen/model_builder
|
77
|
+
- lib/rgen/model_builder/builder_context.rb
|
78
|
+
- lib/rgen/model_builder/model_serializer.rb
|
79
|
+
- lib/rgen/model_builder/reference_resolver.rb
|
80
|
+
- lib/rgen/model_builder.rb
|
66
81
|
- lib/rgen/model_comparator.rb
|
67
82
|
- lib/rgen/model_dumper.rb
|
68
83
|
- lib/rgen/name_helper.rb
|
@@ -77,12 +92,15 @@ files:
|
|
77
92
|
- lib/rgen/template_language/template_helper.rb
|
78
93
|
- lib/rgen/template_language.rb
|
79
94
|
- lib/rgen/transformer.rb
|
95
|
+
- lib/serializers
|
80
96
|
- lib/transformers
|
97
|
+
- lib/transformers/ecore_to_uml13.rb
|
81
98
|
- lib/transformers/uml13_to_ecore.rb
|
82
99
|
- test/array_extensions_test.rb
|
83
100
|
- test/ea_instantiator_test.rb
|
84
101
|
- test/ea_serializer_test
|
85
102
|
- test/ea_serializer_test/ea_testmodel_regenerated.xml
|
103
|
+
- test/ea_serializer_test/ea_testmodel_regenerated_import.log
|
86
104
|
- test/ea_serializer_test.rb
|
87
105
|
- test/ecore_self_test.rb
|
88
106
|
- test/environment_test.rb
|
@@ -94,6 +112,16 @@ files:
|
|
94
112
|
- test/metamodel_roundtrip_test/TestModel.rb
|
95
113
|
- test/metamodel_roundtrip_test/TestModel_Regenerated.rb
|
96
114
|
- test/metamodel_roundtrip_test.rb
|
115
|
+
- test/method_delegation_test.rb
|
116
|
+
- test/model_builder
|
117
|
+
- test/model_builder/builder_context_test.rb
|
118
|
+
- test/model_builder/builder_test.rb
|
119
|
+
- test/model_builder/ecore_internal.rb
|
120
|
+
- test/model_builder/ecore_original.rb
|
121
|
+
- test/model_builder/ecore_original_regenerated.rb
|
122
|
+
- test/model_builder/reference_resolver_test.rb
|
123
|
+
- test/model_builder/serializer_test.rb
|
124
|
+
- test/model_builder_test.rb
|
97
125
|
- test/output_handler_test.rb
|
98
126
|
- test/rgen_test.rb
|
99
127
|
- test/template_language_test
|
@@ -108,21 +136,40 @@ files:
|
|
108
136
|
- test/template_language_test/templates/content
|
109
137
|
- test/template_language_test/templates/content/author.tpl
|
110
138
|
- test/template_language_test/templates/content/chapter.tpl
|
139
|
+
- test/template_language_test/templates/define_local_test
|
140
|
+
- test/template_language_test/templates/define_local_test/local.tpl
|
141
|
+
- test/template_language_test/templates/define_local_test/test.tpl
|
142
|
+
- test/template_language_test/templates/evaluate_test
|
143
|
+
- test/template_language_test/templates/evaluate_test/test.tpl
|
111
144
|
- test/template_language_test/templates/indent_string_test.tpl
|
112
145
|
- test/template_language_test/templates/index
|
113
146
|
- test/template_language_test/templates/index/c
|
114
147
|
- test/template_language_test/templates/index/c/cmod.tpl
|
115
148
|
- test/template_language_test/templates/index/chapter.tpl
|
116
149
|
- test/template_language_test/templates/no_backslash_r_test.tpl
|
150
|
+
- test/template_language_test/templates/no_indent_test
|
151
|
+
- test/template_language_test/templates/no_indent_test/no_indent.tpl
|
152
|
+
- test/template_language_test/templates/no_indent_test/sub1
|
153
|
+
- test/template_language_test/templates/no_indent_test/sub1/no_indent.tpl
|
154
|
+
- test/template_language_test/templates/no_indent_test/test.tpl
|
155
|
+
- test/template_language_test/templates/no_indent_test/test2.tpl
|
156
|
+
- test/template_language_test/templates/no_indent_test/test3.tpl
|
117
157
|
- test/template_language_test/templates/null_context_test.tpl
|
118
158
|
- test/template_language_test/templates/root.tpl
|
159
|
+
- test/template_language_test/templates/template_resolution_test
|
160
|
+
- test/template_language_test/templates/template_resolution_test/sub1
|
161
|
+
- test/template_language_test/templates/template_resolution_test/sub1/sub1.tpl
|
162
|
+
- test/template_language_test/templates/template_resolution_test/sub1.tpl
|
163
|
+
- test/template_language_test/templates/template_resolution_test/test.tpl
|
119
164
|
- test/template_language_test/testout.txt
|
120
165
|
- test/template_language_test.rb
|
121
166
|
- test/testmodel
|
122
167
|
- test/testmodel/class_model_checker.rb
|
123
168
|
- test/testmodel/ea_testmodel.eap
|
124
169
|
- test/testmodel/ea_testmodel.xml
|
170
|
+
- test/testmodel/ea_testmodel_import.log
|
125
171
|
- test/testmodel/ea_testmodel_partial.xml
|
172
|
+
- test/testmodel/ea_testmodel_regenerated.xml
|
126
173
|
- test/testmodel/ecore_model_checker.rb
|
127
174
|
- test/testmodel/manual_testmodel.xml
|
128
175
|
- test/testmodel/object_model_checker.rb
|
@@ -215,6 +262,8 @@ rdoc_options:
|
|
215
262
|
- test
|
216
263
|
- -x
|
217
264
|
- metamodels
|
265
|
+
- -x
|
266
|
+
- ea_support/uml13*
|
218
267
|
require_paths:
|
219
268
|
- lib
|
220
269
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'rgen/instantiator/xmi11_instantiator'
|
2
|
-
require 'metamodels/uml13_metamodel'
|
3
|
-
|
4
|
-
class EAInstantiator < XMI11Instantiator
|
5
|
-
|
6
|
-
#TODO add element names to make feature names unique
|
7
|
-
FIXMAP = {
|
8
|
-
:tags => {
|
9
|
-
"EAStub" => proc { |tag, attr| UML13::Class.new(
|
10
|
-
:name => attr["name"]
|
11
|
-
)},
|
12
|
-
"ActivityModel" => "ActivityGraph",
|
13
|
-
"PseudoState" => "Pseudostate"
|
14
|
-
},
|
15
|
-
:feature_names => {
|
16
|
-
"isOrdered" => "ordering",
|
17
|
-
"subtype" => "child",
|
18
|
-
"supertype" => "parent",
|
19
|
-
"changeable" => "changeability",
|
20
|
-
"substate" => "subvertex"
|
21
|
-
},
|
22
|
-
:feature_values => {
|
23
|
-
"ordering" => {"true" => "ordered", "false" => "unordered"},
|
24
|
-
"aggregation" => {"shared" => "aggregate"},
|
25
|
-
"changeability" => {"none" => "frozen"},
|
26
|
-
"multiplicity" => proc { |v| UML13::Multiplicity.new(
|
27
|
-
:range => [UML13::MultiplicityRange.new(
|
28
|
-
:lower => v.split("..").first,
|
29
|
-
:upper => v.split("..").last
|
30
|
-
)])}
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
def initialize(env, loglevel)
|
35
|
-
super(env, FIXMAP, loglevel)
|
36
|
-
add_metamodel("omg.org/UML1.3", UML13)
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|