tdc 0.3.4 → 0.3.5

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: bf0ce48e5dd1a629ad0c5240f9c3d8c344b46cf368e01bb842eefb3454167b4e
4
- data.tar.gz: a85d7fef856826f3a4a4112c4e4186c1e813f8a52de500466ba0b9acfe559fe5
3
+ metadata.gz: 2f0fa7ec99a40148ff1ca3fccaaa4ffeee29cc12034dc688b0957deeeb5df9a1
4
+ data.tar.gz: 2bcd19c81b665611f4f7abbfc8d23fb79db098b84eb837de5e6e6a67a69d7cf7
5
5
  SHA512:
6
- metadata.gz: 250b3ebace2728d87756a51f7075c3f318637997e5473bb90c4cccd820326f77ebf00429e57e885467d837b969c166b43f5044d75b028022f0dcd1464f7967bd
7
- data.tar.gz: 8082f7dbdcd16c0a7cacb94af1479d0df9e4a12a83ec57556f0e6a865e18d5a5d7fa4d14cc2e3e8c3886c2ae2373bf64733e138072f262b1efc27e89ea259798
6
+ metadata.gz: 7cc7b66e9a063bd23e6ccfc482f187b1c8b1a8b2950e16984785c2f9c5c40615e2fb0375e59afd2d374ca3d782719d5f164ac4a2d177d746f0858551b0804061
7
+ data.tar.gz: dd2476bd5f82a387b89353e790661263d1c28b5c65f901ec01d0f50c3efcf1e716904eacab039f2c39fd44c91f97aeb4dd386dc884a3de07029354c8549acd43
@@ -120,6 +120,10 @@ Style/HashSyntax:
120
120
  Exclude:
121
121
  - 'Rakefile'
122
122
 
123
+ # We are not going to optimize by freezing strings.
124
+ Style/MutableConstant:
125
+ Enabled: false
126
+
123
127
  Style/RedundantAssignment:
124
128
  Enabled: true
125
129
 
@@ -150,6 +154,6 @@ Style/StringLiterals:
150
154
  Style/SymbolArray:
151
155
  Enabled: false
152
156
 
153
- # We are not going to optimize by freezing strings.
154
- Style/MutableConstant:
157
+ # I prefer not to use %w or %W for an array of words.
158
+ Style/WordArray:
155
159
  Enabled: false
@@ -6,12 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.5] - 2020-08-06
10
+
11
+ - Add the `single_entry` method to `CatalogEntries`
12
+
13
+ #### Breaking Changes
14
+
15
+ - Drop the `with_definition` method from `SingularGenerator`
16
+
9
17
  ## [0.3.4] - 2020-08-05
10
18
 
11
19
  #### Breaking Changes
12
20
 
13
21
  - Introduce the `GenerationContext` abstraction
14
- - All generators are initialized with an instance of `Tdc::GenerationContext`
22
+ - All generators are initialized with an instance of `Tdc::Generators::GenerationContext`
15
23
 
16
24
  ## [0.3.3] - 2020-08-04
17
25
 
@@ -12,6 +12,12 @@ module Tdc
12
12
  def empty?
13
13
  to_h.empty?
14
14
  end
15
+
16
+ def single_entry
17
+ raise Tdc::FatalError, "There is more than one entry" if to_h.many?
18
+
19
+ to_h.first.second
20
+ end
15
21
  end
16
22
  end
17
23
  end
@@ -6,24 +6,14 @@ module Tdc
6
6
  # See also StandardGenerator.
7
7
  #
8
8
  class SingularGenerator < Tdc::Generators::ConfigurableGenerator
9
- def with_definition(additional_definitions)
10
- @additional_definitions = additional_definitions.stringify_keys.reject { |_, v| v == :missing_definition }
11
-
12
- self
13
- end
14
-
15
9
  def generate
16
- configure_instance_definition(singular_instance_definition.merge(additional_definitions))
10
+ configure_instance_definition(singular_instance_definition)
17
11
 
18
12
  run_resolvers_and_generate_instance
19
13
  end
20
14
 
21
15
  private
22
16
 
23
- def additional_definitions
24
- @additional_definitions || {}
25
- end
26
-
27
17
  def singular_instance_definition
28
18
  all_instance_definitions = instance_definitions
29
19
 
@@ -1,3 +1,3 @@
1
1
  module Tdc
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
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.4
4
+ version: 0.3.5
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-05 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport