rgen 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/lib/rgen/metamodel_builder.rb +5 -4
- data/lib/rgen/metamodel_builder.rb.bak +196 -0
- data/lib/rgen/metamodel_builder/builder_extensions.rb +51 -38
- data/lib/rgen/metamodel_builder/builder_extensions.rb.bak +437 -0
- data/lib/rgen/metamodel_builder/builder_runtime.rb +2 -20
- data/lib/rgen/metamodel_builder/builder_runtime.rb.bak +73 -0
- data/lib/rgen/name_helper.rb.bak +37 -0
- data/lib/rgen/template_language.rb +8 -0
- data/lib/rgen/template_language.rb.bak +289 -0
- data/lib/rgen/template_language/directory_template_container.rb +11 -0
- data/lib/rgen/template_language/directory_template_container.rb.bak +69 -0
- data/lib/rgen/template_language/output_handler.rb +3 -2
- data/lib/rgen/template_language/output_handler.rb.bak +88 -0
- data/lib/rgen/template_language/template_container.rb +5 -4
- data/lib/rgen/template_language/template_container.rb.bak +196 -0
- data/lib/rgen/transformer.rb.bak +381 -0
- data/test/environment_test.rb.bak +52 -0
- data/test/metamodel_builder_test.rb +6 -0
- data/test/metamodel_builder_test.rb.bak +443 -0
- data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +34 -32
- data/test/metamodel_roundtrip_test/houseMetamodel_Regenerated.ecore +58 -58
- data/test/output_handler_test.rb +8 -0
- data/test/output_handler_test.rb.bak +50 -0
- data/test/template_language_test.rb +23 -0
- data/test/template_language_test.rb.bak +72 -0
- data/test/template_language_test/indentStringTestDefaultIndent.out +1 -0
- data/test/template_language_test/indentStringTestTabIndent.out +1 -0
- data/test/template_language_test/templates/indent_string_test.tpl +12 -0
- data/test/template_language_test/templates/null_context_test.tpl +12 -0
- data/test/transformer_test.rb.bak +223 -0
- metadata +65 -48
- data/lib/rgen/environment.rb.bak +0 -42
data/lib/rgen/environment.rb.bak
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'rgen/find_helper'
|
2
|
-
|
3
|
-
module RGen
|
4
|
-
|
5
|
-
# An Environment is used to hold model elements.
|
6
|
-
#
|
7
|
-
class Environment
|
8
|
-
include RGen::FindHelper
|
9
|
-
|
10
|
-
def initialize
|
11
|
-
@elements = []
|
12
|
-
end
|
13
|
-
|
14
|
-
# Add a model element. Returns the environment so <code><<</code> can be chained.
|
15
|
-
#
|
16
|
-
def <<(el)
|
17
|
-
@elements << el
|
18
|
-
self
|
19
|
-
end
|
20
|
-
|
21
|
-
# Iterates each element
|
22
|
-
#
|
23
|
-
def each(&b)
|
24
|
-
@elements.each(&b)
|
25
|
-
end
|
26
|
-
|
27
|
-
# Return the elements of the environment as an array
|
28
|
-
#
|
29
|
-
def elements
|
30
|
-
@elements.dup
|
31
|
-
end
|
32
|
-
|
33
|
-
# This method can be used to instantiate a class and automatically put it into
|
34
|
-
# the environment. The new instance is returned.
|
35
|
-
#
|
36
|
-
def new(clazz, *args)
|
37
|
-
@elements << clazz.new(*args)
|
38
|
-
@elements[-1]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|