tdc 0.3.6 → 0.3.6.1

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: afd309b8d6f641f50856a6ab71c6557dceba91c43e97c6d23a54f526cc954570
4
- data.tar.gz: c730e903a12d47f4a8dc452a212ae9f38f75a4d2b61a74dd72237e69f0005d47
3
+ metadata.gz: 4a9bab09cb1cb215daa94f3e53b950fd09f1baa059a3c6c8cddf47abd3fd95a7
4
+ data.tar.gz: 2bfccac38422fc897d0c2208e0d5853f0a4adf13074c9da93262476d09007cf1
5
5
  SHA512:
6
- metadata.gz: f699b62e54e48f3b42bb06215a8e783ca15797265292e988f70f4cbc82191aa55174ccfbcdf1bb50b58ccb1323716272d7d958283b49eac45dbb1c948208f616
7
- data.tar.gz: 7496da7a34c508a1b132a5232f1c061eded18b8b5057192728be98b3faae095b3c3e1dd377b2563fde95f897861bcedb932bf867c8f20c4e3f09621af18cf52d
6
+ metadata.gz: 41e0866b7801d672791f6ea28d6878072f009aa31281d06889a2782c38464d79e2e2f3fd175d45cc9dbe9867491e07811fc58d1dffa0c1a1cd3c37d15f77c004
7
+ data.tar.gz: 63588b60c890b674dd4541e10b848f97108d7244f63cce86fcbb26f7daf5b25689791f436fa10aa3545604cfdbca1422d1c61cf90d4cff7804ec726b1c50aec0
@@ -2,39 +2,19 @@ require:
2
2
  - rubocop-rspec
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
5
+ NewCops: enable
6
+ TargetRubyVersion: 2.6
6
7
 
7
8
  Exclude:
8
9
  - 'bin/**/*'
9
10
 
10
- Layout/EmptyLinesAroundAttributeAccessor:
11
- Enabled: true
12
-
13
- Metrics/LineLength:
11
+ Layout/LineLength:
14
12
  Max: 120
15
13
 
16
14
  # Rubocop and I cannot agree.
17
15
  Layout/MultilineMethodCallBraceLayout:
18
16
  Enabled: false
19
17
 
20
- Layout/SpaceAroundMethodCallOperator:
21
- Enabled: true
22
-
23
- Lint/DeprecatedOpenSSLConstant:
24
- Enabled: true
25
-
26
- Lint/DuplicateElsifCondition:
27
- Enabled: true
28
-
29
- Lint/MixedRegexpCaptureTypes:
30
- Enabled: true
31
-
32
- Lint/RaiseException:
33
- Enabled: true
34
-
35
- Lint/StructNewOverride:
36
- Enabled: true
37
-
38
18
  Metrics/BlockLength:
39
19
  Enabled: false
40
20
 
@@ -68,15 +48,6 @@ RSpec/MultipleExpectations:
68
48
  RSpec/SubjectStub:
69
49
  Enabled: false
70
50
 
71
- Style/AccessorGrouping:
72
- Enabled: true
73
-
74
- Style/ArrayCoercion:
75
- Enabled: true
76
-
77
- Style/BisectedAttrAccessor:
78
- Enabled: true
79
-
80
51
  Style/BlockDelimiters:
81
52
  Enabled: true
82
53
  EnforcedStyle: line_count_based
@@ -84,37 +55,16 @@ Style/BlockDelimiters:
84
55
  - 'let'
85
56
  - 'subject'
86
57
 
87
- Style/CaseLikeIf:
88
- Enabled: true
89
-
90
58
  Style/Documentation:
91
59
  Enabled: false
92
60
 
93
61
  Style/EmptyMethod:
94
62
  EnforcedStyle: expanded
95
63
 
96
- Style/ExponentialNotation:
97
- Enabled: true
98
-
99
64
  # We can ignore this small performance improvement.
100
65
  Style/FrozenStringLiteralComment:
101
66
  Enabled: false
102
67
 
103
- Style/HashAsLastArrayItem:
104
- Enabled: true
105
-
106
- Style/HashEachMethods:
107
- Enabled: true
108
-
109
- Style/HashLikeCase:
110
- Enabled: true
111
-
112
- Style/HashTransformKeys:
113
- Enabled: true
114
-
115
- Style/HashTransformValues:
116
- Enabled: true
117
-
118
68
  # We like to use the hash rocket in rake files.
119
69
  Style/HashSyntax:
120
70
  Exclude:
@@ -124,21 +74,6 @@ Style/HashSyntax:
124
74
  Style/MutableConstant:
125
75
  Enabled: false
126
76
 
127
- Style/RedundantAssignment:
128
- Enabled: true
129
-
130
- Style/RedundantFetchBlock:
131
- Enabled: true
132
-
133
- Style/RedundantFileExtensionInRequire:
134
- Enabled: true
135
-
136
- Style/RedundantRegexpCharacterClass:
137
- Enabled: true
138
-
139
- Style/RedundantRegexpEscape:
140
- Enabled: true
141
-
142
77
  # No need to mention StandardError.
143
78
  Style/RescueStandardError:
144
79
  EnforcedStyle: implicit
@@ -6,6 +6,10 @@ 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.1] - 2020-08-10
10
+
11
+ - Add the AtxContextFactory abstraction
12
+
9
13
  ## [0.3.6] - 2020-08-06
10
14
 
11
15
  #### Breaking Changes
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/atx_context_factory"
22
23
  require "tdc/generators/generation_context"
23
24
 
24
25
  # Current Catalog
@@ -6,6 +6,8 @@ module Tdc
6
6
  EMPTY_DEFINITIONS = []
7
7
 
8
8
  def initialize(catalog_root_directory)
9
+ super()
10
+
9
11
  @catalog_root_directory = catalog_root_directory
10
12
  end
11
13
 
@@ -8,6 +8,8 @@ module Tdc
8
8
  attr_reader :key, :source
9
9
 
10
10
  def initialize(key:, source:)
11
+ super()
12
+
11
13
  @key = key
12
14
  @source = source
13
15
  end
@@ -0,0 +1,16 @@
1
+ module Tdc
2
+ module Generators
3
+ #
4
+ # Knows a class instance that supplies the instance_eval context for interpreting _atx attribute values.
5
+ #
6
+ class AtxContextFactory
7
+ include Singleton
8
+
9
+ attr_reader :context
10
+
11
+ def initialize
12
+ @context = Time.zone
13
+ end
14
+ end
15
+ end
16
+ end
@@ -3,8 +3,6 @@ module Tdc
3
3
  #
4
4
  # Knows how to provide a configurable instance definition.
5
5
  #
6
- # Shared implementation between the StandardGenerator and the SingularGenerator abstract classes.
7
- #
8
6
  class ConfigurableGenerator < Tdc::Generators::GeneratorBase
9
7
  include Tdc::Generators::DefinitionSourcable
10
8
 
@@ -44,9 +42,6 @@ module Tdc
44
42
  def run_atx_resolvers(instance_definition)
45
43
  atx_definitions = instance_definition.select { |k, _v| /_atx$/ =~ k }
46
44
 
47
- # ARM (2020-08-04): Move all the way out so that all generators use the same atx_context.
48
- atx_context = Time.zone
49
-
50
45
  atx_definitions.each do |k, v|
51
46
  # Remove the original _atx attribute.
52
47
  instance_definition.delete(k)
@@ -55,6 +50,10 @@ module Tdc
55
50
  instance_definition[k.delete_suffix("x")] = atx_context.instance_eval(v)
56
51
  end
57
52
  end
53
+
54
+ def atx_context
55
+ Tdc::Generators::AtxContextFactory.instance.context
56
+ end
58
57
  end
59
58
  end
60
59
  end
@@ -38,7 +38,7 @@ module Tdc
38
38
  definition_source&.key?(key) ? definition_source.fetch(key) : super
39
39
  end
40
40
 
41
- def respond_to_missing?(method, include_all = false)
41
+ def respond_to_missing?(method, include_all = false) # rubocop:disable Style/OptionalBooleanParameter
42
42
  key = transform_method_to_definition_source_key(method)
43
43
 
44
44
  definition_source&.key?(key) ? true : super
@@ -4,6 +4,8 @@ module Tdc
4
4
  #
5
5
  class InMemoryDataDefinition < Tdc::DataDefinition
6
6
  def initialize(path_elements_data = {})
7
+ super()
8
+
7
9
  @store = path_elements_data
8
10
  end
9
11
 
@@ -1,3 +1,3 @@
1
1
  module Tdc
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.6.1"
3
3
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_development_dependency "rake", ">= 12.1", "< 13.1"
34
34
  spec.add_development_dependency "rspec", ">= 3.9", "< 4.0"
35
- spec.add_development_dependency "rubocop", "~> 0.88"
35
+ spec.add_development_dependency "rubocop", "~> 0.89"
36
36
  spec.add_development_dependency "rubocop-rspec", "~> 1.42"
37
37
  spec.add_development_dependency "simplecov", "~> 0.17"
38
38
  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.6
4
+ version: 0.3.6.1
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-07 00:00:00.000000000 Z
11
+ date: 2020-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '0.88'
73
+ version: '0.89'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '0.88'
80
+ version: '0.89'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rubocop-rspec
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -133,6 +133,7 @@ files:
133
133
  - lib/tdc/definition_resolvers/tag_resolver.rb
134
134
  - lib/tdc/fatal_error.rb
135
135
  - lib/tdc/generators.rb
136
+ - lib/tdc/generators/atx_context_factory.rb
136
137
  - lib/tdc/generators/catalog_entries.rb
137
138
  - lib/tdc/generators/configurable_generator.rb
138
139
  - lib/tdc/generators/definition_resolvable.rb