tdc 0.3.5 → 0.3.6
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/README.md +1 -1
- data/images/Tdc.png +0 -0
- data/lib/tdc.rb +0 -1
- data/lib/tdc/version.rb +1 -1
- metadata +1 -2
- data/lib/tdc/generators/singular_generator.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd309b8d6f641f50856a6ab71c6557dceba91c43e97c6d23a54f526cc954570
|
4
|
+
data.tar.gz: c730e903a12d47f4a8dc452a212ae9f38f75a4d2b61a74dd72237e69f0005d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f699b62e54e48f3b42bb06215a8e783ca15797265292e988f70f4cbc82191aa55174ccfbcdf1bb50b58ccb1323716272d7d958283b49eac45dbb1c948208f616
|
7
|
+
data.tar.gz: 7496da7a34c508a1b132a5232f1c061eded18b8b5057192728be98b3faae095b3c3e1dd377b2563fde95f897861bcedb932bf867c8f20c4e3f09621af18cf52d
|
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.6] - 2020-08-06
|
10
|
+
|
11
|
+
#### Breaking Changes
|
12
|
+
|
13
|
+
- Drop the `SingularGenerator` abstraction
|
14
|
+
|
9
15
|
## [0.3.5] - 2020-08-06
|
10
16
|
|
11
17
|
- Add the `single_entry` method to `CatalogEntries`
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
**Extension Points**
|
6
6
|
|
7
|
-
Define your own test data generators by inheriting from ```StandardGenerator
|
7
|
+
Define your own test data generators by inheriting from ```StandardGenerator```. Best practice is to define an ```ApplicationStandardGenerator``` and have all other generators inherit from it.
|
8
8
|
|
9
9
|
Define your own definition resolvers by inheriting from ```DefinitionResolver```. Best practice is to define an ```ApplicationDefinitionResolver``` and all other definition resolvers inherit from it.
|
10
10
|
|
data/images/Tdc.png
CHANGED
Binary file
|
data/lib/tdc.rb
CHANGED
@@ -31,7 +31,6 @@ require "tdc/generators/definition_sourcable"
|
|
31
31
|
# Generator Hierarchy
|
32
32
|
require "tdc/generators/generator_base"
|
33
33
|
require "tdc/generators/configurable_generator"
|
34
|
-
require "tdc/generators/singular_generator"
|
35
34
|
require "tdc/generators/standard_generator"
|
36
35
|
|
37
36
|
# Definition Resolvers
|
data/lib/tdc/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair McKinnell
|
@@ -139,7 +139,6 @@ files:
|
|
139
139
|
- lib/tdc/generators/definition_sourcable.rb
|
140
140
|
- lib/tdc/generators/generation_context.rb
|
141
141
|
- lib/tdc/generators/generator_base.rb
|
142
|
-
- lib/tdc/generators/singular_generator.rb
|
143
142
|
- lib/tdc/generators/standard_generator.rb
|
144
143
|
- lib/tdc/in_memory_data_definition.rb
|
145
144
|
- lib/tdc/missing_override_error.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Tdc
|
2
|
-
module Generators
|
3
|
-
#
|
4
|
-
# Abstract class for defining generators that define a single model instance.
|
5
|
-
#
|
6
|
-
# See also StandardGenerator.
|
7
|
-
#
|
8
|
-
class SingularGenerator < Tdc::Generators::ConfigurableGenerator
|
9
|
-
def generate
|
10
|
-
configure_instance_definition(singular_instance_definition)
|
11
|
-
|
12
|
-
run_resolvers_and_generate_instance
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def singular_instance_definition
|
18
|
-
all_instance_definitions = instance_definitions
|
19
|
-
|
20
|
-
if all_instance_definitions.many?
|
21
|
-
raise Tdc::FatalError, "A singular generator only generates a single model instance"
|
22
|
-
end
|
23
|
-
|
24
|
-
# Delete the tag so that the models do not need to filter it out.
|
25
|
-
all_instance_definitions.first.except("tag")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|