rgen 0.8.4 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/Project.yaml +6 -5
- data/Rakefile +0 -1
- data/lib/rgen/ecore/ecore.rb +6 -0
- data/lib/rgen/ecore/ecore_to_json.rb +4 -3
- data/test/metamodel_builder_test.rb +4 -4
- metadata +25 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5091748f0290a5b0c82cf66e3bf2fea91ac774f6
|
4
|
+
data.tar.gz: db0663f172064272ed0bcd037e6715c12729429b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1355aa9282e5c3a18a93b65788f4fb5a4f92b26bb5cf89fa50e7ec71bd63dad090af06b73e292e959a7750fe08d75a5e0e4a5f0010fe84bb162c6eed1af338d1
|
7
|
+
data.tar.gz: 3f8755a969d35c22d4d8b3bcabeb6c75799b48b416d242a83530afbdc8b7364e682ba59750eddc375a454b450ef1ed5d32941951d7397430f4172d37aa1841a7
|
data/CHANGELOG
CHANGED
@@ -222,3 +222,7 @@
|
|
222
222
|
|
223
223
|
* Add early loading for types which have attributes conflicting with Ruby reserved words.
|
224
224
|
* Change type checking code to use ObjectSpace to find class objects. This is to find classes with an unbound name.
|
225
|
+
|
226
|
+
=0.9.0
|
227
|
+
|
228
|
+
* Update to support Ruby 2.7, drop support for older Rubies
|
data/Project.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
name: rgen
|
2
2
|
gemspec: rgen.gemspec
|
3
3
|
git: https://github.com/mthiede/rgen.git
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
summary: Ruby Modelling and Generator Framework
|
6
6
|
email: martin dot thiede at gmx de
|
7
7
|
homepage: http://ruby-gen.org
|
@@ -15,7 +15,8 @@ exclude_files: ['**/*.bak']
|
|
15
15
|
encrypt_sources: false
|
16
16
|
dependencies:
|
17
17
|
https://rubygems.org:
|
18
|
-
- {name: nokogiri, version: ['
|
19
|
-
- {name: rake, version: '~> 12.0',
|
20
|
-
- {name: minitest, version: ['~> 5.0', '>= 5.10.1'],
|
21
|
-
- {name: minitest-fail-fast, version: '~> 0.1.0',
|
18
|
+
- {name: nokogiri, version: ['>= 1.11.2', '< 1.12'], development: true}
|
19
|
+
- {name: rake, version: '~> 12.0', development: true}
|
20
|
+
- {name: minitest, version: ['~> 5.0', '>= 5.10.1'], development: true}
|
21
|
+
- {name: minitest-fail-fast, version: '~> 0.1.0', development: true}
|
22
|
+
- {name: andand, version: '1.3.3', development: true}
|
data/Rakefile
CHANGED
data/lib/rgen/ecore/ecore.rb
CHANGED
@@ -12,9 +12,11 @@ module RGen
|
|
12
12
|
extend RGen::MetamodelBuilder::ModuleExtension
|
13
13
|
|
14
14
|
class EObject < RGen::MetamodelBuilder::MMBase
|
15
|
+
abstract
|
15
16
|
end
|
16
17
|
|
17
18
|
class EModelElement < RGen::MetamodelBuilder::MMBase
|
19
|
+
abstract
|
18
20
|
end
|
19
21
|
|
20
22
|
class EAnnotation < RGen::MetamodelBuilder::MMMultiple(EModelElement, EObject)
|
@@ -22,10 +24,12 @@ module RGen
|
|
22
24
|
end
|
23
25
|
|
24
26
|
class ENamedElement < EModelElement
|
27
|
+
abstract
|
25
28
|
has_attr 'name', String
|
26
29
|
end
|
27
30
|
|
28
31
|
class ETypedElement < ENamedElement
|
32
|
+
abstract
|
29
33
|
has_attr 'lowerBound', Integer, :defaultValueLiteral => "0"
|
30
34
|
has_attr 'ordered', Boolean, :defaultValueLiteral => "true"
|
31
35
|
has_attr 'unique', Boolean, :defaultValueLiteral => "true"
|
@@ -43,6 +47,7 @@ module RGen
|
|
43
47
|
end
|
44
48
|
|
45
49
|
class EStructuralFeature < ETypedElement
|
50
|
+
abstract
|
46
51
|
has_attr 'changeable', Boolean, :defaultValueLiteral => "true"
|
47
52
|
has_attr 'defaultValue', Object, :derived=>true
|
48
53
|
has_attr 'defaultValueLiteral', String
|
@@ -76,6 +81,7 @@ module RGen
|
|
76
81
|
end
|
77
82
|
|
78
83
|
class EClassifier < ENamedElement
|
84
|
+
abstract
|
79
85
|
has_attr 'defaultValue', Object, :derived=>true
|
80
86
|
has_attr 'instanceClass', Object, :derived=>true
|
81
87
|
has_attr 'instanceClassName', String
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rgen/ecore/ecore'
|
2
2
|
require 'json'
|
3
|
+
require 'andand'
|
3
4
|
|
4
5
|
module RGen
|
5
6
|
|
@@ -105,10 +106,9 @@ def eenum(enum)
|
|
105
106
|
merge(edatatype(enum), {
|
106
107
|
:_class_ref => 'RGen.ECore.EEnum',
|
107
108
|
:eLiterals => enum.eLiterals.map do |l|
|
108
|
-
merge(
|
109
|
+
merge(enamedelement(l), {
|
109
110
|
:_class_ref => 'RGen.ECore.EEnumLiteral',
|
110
111
|
:value => l.value,
|
111
|
-
:literal => l.literal
|
112
112
|
})
|
113
113
|
end
|
114
114
|
})
|
@@ -116,6 +116,7 @@ end
|
|
116
116
|
|
117
117
|
def eannotation(e)
|
118
118
|
merge(emodelelement(e), {
|
119
|
+
:_class_ref => 'RGen.ECore.EAnnotation',
|
119
120
|
:source => e.source,
|
120
121
|
:details => e.details.map do |d|
|
121
122
|
merge({}, {
|
@@ -172,7 +173,7 @@ def ref_id(obj)
|
|
172
173
|
end
|
173
174
|
|
174
175
|
def ref_parts(obj)
|
175
|
-
return [obj.name] unless obj
|
176
|
+
return [obj.name] unless obj.andand.eContainer
|
176
177
|
ref_parts(obj.eContainer) << obj.name
|
177
178
|
end
|
178
179
|
|
@@ -196,7 +196,7 @@ class MetamodelBuilderTest < MiniTest::Test
|
|
196
196
|
err = assert_raises StandardError do
|
197
197
|
sc.name = 5
|
198
198
|
end
|
199
|
-
assert_match /In (\w+::)+SimpleClass : Can not use a Fixnum where a String is expected/, err.message
|
199
|
+
assert_match /In (\w+::)+SimpleClass : Can not use a (Integer|Fixnum) where a String is expected/, err.message
|
200
200
|
assert_equal "EString", mm::SimpleClass.ecore.eAttributes.find{|a| a.name=="name"}.eType.name
|
201
201
|
|
202
202
|
assert_equal "xtest", sc.stringWithDefault
|
@@ -264,7 +264,7 @@ class MetamodelBuilderTest < MiniTest::Test
|
|
264
264
|
assert_equal "123456789012345680.0", sprintf("%.1f", sc.floatWithDefault)
|
265
265
|
end
|
266
266
|
sc.floatWithDefault = nil
|
267
|
-
sc.floatWithDefault = BigDecimal
|
267
|
+
sc.floatWithDefault = BigDecimal("123456789012345678.0")
|
268
268
|
assert sc.floatWithDefault.is_a?(BigDecimal)
|
269
269
|
assert_equal "123456789012345678.0", sc.floatWithDefault.to_s("F")
|
270
270
|
|
@@ -298,7 +298,7 @@ class MetamodelBuilderTest < MiniTest::Test
|
|
298
298
|
err = assert_raises(StandardError) do
|
299
299
|
o.addLiterals(1)
|
300
300
|
end
|
301
|
-
assert_match /In (\w+::)+ManyAttrClass : Can not use a Fixnum where a String is expected/, err.message
|
301
|
+
assert_match /In (\w+::)+ManyAttrClass : Can not use a (Integer|Fixnum) where a String is expected/, err.message
|
302
302
|
|
303
303
|
assert_equal [], o.literals
|
304
304
|
o.addLiterals("a")
|
@@ -333,7 +333,7 @@ class MetamodelBuilderTest < MiniTest::Test
|
|
333
333
|
err = assert_raises(StandardError) do
|
334
334
|
o.literals = 1
|
335
335
|
end
|
336
|
-
assert_match /In (\w+::)+ManyAttrClass : Can not use a Fixnum where a Enumerable is expected/, err.message
|
336
|
+
assert_match /In (\w+::)+ManyAttrClass : Can not use a (Integer|Fixnum) where a Enumerable is expected/, err.message
|
337
337
|
|
338
338
|
o.bools = [true, false, true, false]
|
339
339
|
assert_equal [true, false, true, false], o.bools
|
metadata
CHANGED
@@ -1,35 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Thiede
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.6.0
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.
|
19
|
+
version: 1.11.2
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.12'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.6.0
|
30
27
|
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.
|
29
|
+
version: 1.11.2
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.12'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: 0.1.0
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: andand
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - '='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 1.3.3
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 1.3.3
|
81
95
|
description: RGen is a framework for Model Driven Software Development (MDSD) in Ruby.
|
82
96
|
This means that it helps you build Metamodels, instantiate Models, modify and transform
|
83
97
|
Models and finally generate arbitrary textual content from it.
|
@@ -278,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
292
|
version: '0'
|
279
293
|
requirements: []
|
280
294
|
rubyforge_project:
|
281
|
-
rubygems_version: 2.
|
295
|
+
rubygems_version: 2.6.14
|
282
296
|
signing_key:
|
283
297
|
specification_version: 4
|
284
298
|
summary: Ruby Modelling and Generator Framework
|