tdc 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/images/Tdc.png +0 -0
- data/lib/tdc.rb +0 -1
- data/lib/tdc/generators/standard_generator.rb +45 -4
- data/lib/tdc/version.rb +1 -1
- metadata +2 -3
- data/lib/tdc/generators/configurable_generator.rb +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40158a1118d92cb453c0197da1eea7850c19ba2bba98306806bf920f167d16b8
|
4
|
+
data.tar.gz: '09f31030294fadabb38f88c6976d56774670b636ec43bb2ae4d62a96ad234087'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40758219403185741dbc04f645f5f7d19a07ff004514cf5c5d9c7a4312085d4918d8d2694204c643bcb97f808c8c958b002b7c2e684748d8d1621e1b9f49f182
|
7
|
+
data.tar.gz: 41777ff45589fc3de09026e86e0e26220cd863a95861fd866a337f53b23ec0211f4d4ced7d0feac6cabbf563175f6b6234888b441c80d30bd848bad2f42cef16
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.3.9] - 2020-08-12
|
10
|
+
|
11
|
+
#### Breaking Changes
|
12
|
+
|
13
|
+
- Collapse `ConfigurableGenerator` into `StandardGenerator`
|
14
|
+
|
9
15
|
## [0.3.8] - 2020-08-11
|
10
16
|
|
11
17
|
#### New Features
|
data/images/Tdc.png
CHANGED
Binary file
|
data/lib/tdc.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
module Tdc
|
2
2
|
module Generators
|
3
3
|
#
|
4
|
-
#
|
4
|
+
# Knows how to provide a configurable instance definition.
|
5
5
|
#
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
class StandardGenerator < Tdc::Generators::GeneratorBase
|
7
|
+
include Tdc::Generators::DefinitionSourcable
|
8
|
+
|
9
|
+
attr_reader :instance_definition
|
10
|
+
|
11
|
+
source_definition_from :instance_definition
|
12
|
+
|
9
13
|
def generate
|
10
14
|
CatalogEntries.new.tap do |catalog_entries|
|
11
15
|
instance_definitions.each do |instance_definition|
|
@@ -21,6 +25,43 @@ module Tdc
|
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
28
|
+
|
29
|
+
def run_resolvers_and_generate_instance
|
30
|
+
run_extended_attribute_interpreters(instance_definition)
|
31
|
+
run_definition_resolvers(instance_definition)
|
32
|
+
|
33
|
+
generate_instance
|
34
|
+
end
|
35
|
+
|
36
|
+
#
|
37
|
+
# Hook method: subclasses are expected to define how to generate a model instance.
|
38
|
+
#
|
39
|
+
def generate_instance
|
40
|
+
raise Tdc::MissingOverrideError, "Implement the 'generate_instance' method"
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Hook method: subclasses may include the DefinitionResolvable concern to override.
|
45
|
+
#
|
46
|
+
def run_definition_resolvers(_instance_definition)
|
47
|
+
# Do nothing
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def configure_instance_definition(instance_definition)
|
53
|
+
@instance_definition = instance_definition
|
54
|
+
|
55
|
+
configure_definition_source(instance_definition)
|
56
|
+
end
|
57
|
+
|
58
|
+
def run_extended_attribute_interpreters(instance_definition)
|
59
|
+
interpreters.each { |interpreter| interpreter.interpret(instance_definition) }
|
60
|
+
end
|
61
|
+
|
62
|
+
def interpreters
|
63
|
+
Tdc::ExtendedAttributes::InterpreterRegistry.instance.interpreters
|
64
|
+
end
|
24
65
|
end
|
25
66
|
end
|
26
67
|
end
|
data/lib/tdc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair McKinnell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -138,7 +138,6 @@ files:
|
|
138
138
|
- lib/tdc/fatal_error.rb
|
139
139
|
- lib/tdc/generators.rb
|
140
140
|
- lib/tdc/generators/catalog_entries.rb
|
141
|
-
- lib/tdc/generators/configurable_generator.rb
|
142
141
|
- lib/tdc/generators/definition_resolvable.rb
|
143
142
|
- lib/tdc/generators/definition_sourcable.rb
|
144
143
|
- lib/tdc/generators/generation_context.rb
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module Tdc
|
2
|
-
module Generators
|
3
|
-
#
|
4
|
-
# Knows how to provide a configurable instance definition.
|
5
|
-
#
|
6
|
-
class ConfigurableGenerator < Tdc::Generators::GeneratorBase
|
7
|
-
include Tdc::Generators::DefinitionSourcable
|
8
|
-
|
9
|
-
attr_reader :instance_definition
|
10
|
-
|
11
|
-
source_definition_from :instance_definition
|
12
|
-
|
13
|
-
def run_resolvers_and_generate_instance
|
14
|
-
run_extended_attribute_interpreters(instance_definition)
|
15
|
-
run_definition_resolvers(instance_definition)
|
16
|
-
|
17
|
-
generate_instance
|
18
|
-
end
|
19
|
-
|
20
|
-
#
|
21
|
-
# Hook method: subclasses are expected to define how to generate a model instance.
|
22
|
-
#
|
23
|
-
def generate_instance
|
24
|
-
raise Tdc::MissingOverrideError, "Implement the 'generate_instance' method"
|
25
|
-
end
|
26
|
-
|
27
|
-
#
|
28
|
-
# Hook method: subclasses may include the DefinitionResolvable concern to override.
|
29
|
-
#
|
30
|
-
def run_definition_resolvers(_instance_definition)
|
31
|
-
# Do nothing
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
def configure_instance_definition(instance_definition)
|
37
|
-
@instance_definition = instance_definition
|
38
|
-
|
39
|
-
configure_definition_source(instance_definition)
|
40
|
-
end
|
41
|
-
|
42
|
-
def run_extended_attribute_interpreters(instance_definition)
|
43
|
-
interpreters.each { |interpreter| interpreter.interpret(instance_definition) }
|
44
|
-
end
|
45
|
-
|
46
|
-
def interpreters
|
47
|
-
Tdc::ExtendedAttributes::InterpreterRegistry.instance.interpreters
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|