tdc 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e58c0fcfbfa32aa0dde6627786e39bbfaff4140d3326f144925113031163faf8
4
- data.tar.gz: e9b5f186a199bd2cc3479fd9fd48087fd0f1d433006c03f2502c2cb48c6f300d
3
+ metadata.gz: bf0ce48e5dd1a629ad0c5240f9c3d8c344b46cf368e01bb842eefb3454167b4e
4
+ data.tar.gz: a85d7fef856826f3a4a4112c4e4186c1e813f8a52de500466ba0b9acfe559fe5
5
5
  SHA512:
6
- metadata.gz: 10a3a536987b80e57169defc47b65496550fc3c9ba4fa91d9c6ec448b8debd77d24d44cf5dbe047d708979fd4d29e4b1186ef712d0cfcb0b094cd0418d6d2524
7
- data.tar.gz: cfd63f4adcb438992e71a4e9ac8c20024c9b1f0d68d4a8eda5765456cb7054c602a3b7f97178f66f5c5e0876314180fd42404c7100d29382d544834e2239f010
6
+ metadata.gz: 250b3ebace2728d87756a51f7075c3f318637997e5473bb90c4cccd820326f77ebf00429e57e885467d837b969c166b43f5044d75b028022f0dcd1464f7967bd
7
+ data.tar.gz: 8082f7dbdcd16c0a7cacb94af1479d0df9e4a12a83ec57556f0e6a865e18d5a5d7fa4d14cc2e3e8c3886c2ae2373bf64733e138072f262b1efc27e89ea259798
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.4] - 2020-08-05
10
+
11
+ #### Breaking Changes
12
+
13
+ - Introduce the `GenerationContext` abstraction
14
+ - All generators are initialized with an instance of `Tdc::GenerationContext`
15
+
9
16
  ## [0.3.3] - 2020-08-04
10
17
 
11
18
  - Add the `empty?` method to `CatalogEntries`
@@ -55,5 +62,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55
62
  #### New Features
56
63
 
57
64
  - Avoid all PackManager dependencies
58
-
59
-
data/lib/tdc.rb CHANGED
@@ -19,6 +19,7 @@ require "tdc/with_indifferent_access_decorator"
19
19
 
20
20
  # Generators
21
21
  require "tdc/generators"
22
+ require "tdc/generators/generation_context"
22
23
 
23
24
  # Current Catalog
24
25
  require "tdc/generators/catalog_entries"
@@ -0,0 +1,15 @@
1
+ module Tdc
2
+ module Generators
3
+ #
4
+ # Knows all the parameters that define the context for generation.
5
+ #
6
+ class GenerationContext
7
+ attr_reader :current_catalog, :data_definition
8
+
9
+ def initialize(current_catalog:, data_definition:)
10
+ @current_catalog = current_catalog
11
+ @data_definition = data_definition
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,11 +4,13 @@ module Tdc
4
4
  # Abstract base class for all Test Data Catalog generators.
5
5
  #
6
6
  class GeneratorBase
7
- attr_reader :data_definition, :current_catalog
7
+ attr_reader :generation_context
8
8
 
9
- def initialize(data_definition, current_catalog)
10
- @data_definition = data_definition
11
- @current_catalog = current_catalog
9
+ # ARM (2020-08-05): For backwards compatibility. Consider removing.
10
+ delegate :current_catalog, :data_definition, to: :generation_context
11
+
12
+ def initialize(generation_context)
13
+ @generation_context = generation_context
12
14
  end
13
15
 
14
16
  def generate
@@ -1,3 +1,3 @@
1
1
  module Tdc
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
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.3
4
+ version: 0.3.4
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-04 00:00:00.000000000 Z
11
+ date: 2020-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -137,6 +137,7 @@ files:
137
137
  - lib/tdc/generators/configurable_generator.rb
138
138
  - lib/tdc/generators/definition_resolvable.rb
139
139
  - lib/tdc/generators/definition_sourcable.rb
140
+ - lib/tdc/generators/generation_context.rb
140
141
  - lib/tdc/generators/generator_base.rb
141
142
  - lib/tdc/generators/singular_generator.rb
142
143
  - lib/tdc/generators/standard_generator.rb