tdc 0.4.3.1 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f01cdb5f72c9481d031888d6c1729d6ba6976c79184807dfeb4213fa3205ee99
4
- data.tar.gz: 64ef598c74252a48925ad77c9f779df6c7a45957bb8b2cf641122981c9cfcc30
3
+ metadata.gz: cb3c229b0784bc8c94f413b0302eeb67724754a117ee21a6cebe94aaab9f421c
4
+ data.tar.gz: 92ce9adcb19eea932c0720dd7b7d9833d22512842a98afe7634ea99dae070768
5
5
  SHA512:
6
- metadata.gz: d093ea28c783c4a5b62c951c815cfb915c7ae7cf13ec2e97cb6ddaceedb09b968b6bb6bf9d80723d8146edac1c7bb6c562d59dec957d074cd67f985a0ce4c79f
7
- data.tar.gz: c99360136e1857226fef356850499c8aa4bfbe5762c808ab115e4ca40bf4a8f9b097d06dc7c277e0b50e77e9655a2056dc544ca733552238c6de3b203b391c37
6
+ metadata.gz: 432b68da9444ebffd4ff1f1c10fa921d4f378f63325c4b6e1656d88d894134b53e92848b330efb9be1e20114f8df89014f1828bc13dd08f9e642362aa971abf7
7
+ data.tar.gz: 200af92ff38ac6a5331eff0a428d0553a6423f1c6f1e4e0ee34d80a11c874253bf775c0bd9386eb4539c223f24653ebd935651d073394fb0e08f728945533b54
@@ -15,9 +15,16 @@ Layout/LineLength:
15
15
  Layout/MultilineMethodCallBraceLayout:
16
16
  Enabled: false
17
17
 
18
- Metrics/BlockLength:
18
+ # Revisit. Seems a little harsh.
19
+ Lint/MissingSuper:
19
20
  Enabled: false
20
21
 
22
+ Metrics/BlockLength:
23
+ Exclude:
24
+ - 'tdc.gemspec'
25
+ - '**/*_shared_example.rb'
26
+ - '**/*_spec.rb'
27
+
21
28
  Naming/MemoizedInstanceVariableName:
22
29
  EnforcedStyleForLeadingUnderscores: required
23
30
 
@@ -0,0 +1,7 @@
1
+ appraise "rails-5" do
2
+ gem "rails", "5.2.4.4"
3
+ end
4
+
5
+ appraise "rails-6" do
6
+ gem "rails", "6.0.3.4"
7
+ end
@@ -6,6 +6,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.7] - 2020-11-04
10
+
11
+ - Support Rails 6.0.x
12
+
13
+ ## [0.4.6.1] - 2020-09-29
14
+
15
+ - Add the #catalog_root_directory method to DataDefinitionFileReader
16
+
17
+ ## [0.4.6] - 2020-09-26
18
+
19
+ - Better error message when a tag cannot be resolved
20
+
21
+ Note: version `0.4.5` was yanked from RubyGems.
22
+
23
+ ## [0.4.4.1] - 2020-09-12
24
+
25
+ - Avoid registering the same class of interpreter a second time
26
+
27
+ ## [0.4.4] - 2020-08-25
28
+
29
+ #### Breaking Changes
30
+
31
+ - Enable ERB expansion of the YAML source with a `.yam.erb` filename suffix.
32
+
9
33
  ## [0.4.3] - 2020-08-25
10
34
 
11
35
  #### New Features
data/Gemfile CHANGED
@@ -2,6 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in tdc.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/Rakefile CHANGED
@@ -1,8 +1,17 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
3
  require "rubocop/rake_task"
4
+ require "rubycritic/rake_task"
4
5
 
5
- RuboCop::RakeTask.new
6
6
  RSpec::Core::RakeTask.new(:spec)
7
+ RuboCop::RakeTask.new
8
+
9
+ RubyCritic::RakeTask.new do |task|
10
+ files = FileList["**/*.rb"]
11
+ files.exclude("**/*_spec.rb")
12
+ files.exclude("**/*_shared_example.rb")
13
+
14
+ task.paths = files
15
+ end
7
16
 
8
17
  task :default => [:rubocop, :spec]
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "5.2.4.4"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,236 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ tdc (0.4.6.1)
5
+ activesupport (>= 5.2.4, < 6.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (5.2.4.4)
11
+ actionpack (= 5.2.4.4)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.4.4)
15
+ actionpack (= 5.2.4.4)
16
+ actionview (= 5.2.4.4)
17
+ activejob (= 5.2.4.4)
18
+ mail (~> 2.5, >= 2.5.4)
19
+ rails-dom-testing (~> 2.0)
20
+ actionpack (5.2.4.4)
21
+ actionview (= 5.2.4.4)
22
+ activesupport (= 5.2.4.4)
23
+ rack (~> 2.0, >= 2.0.8)
24
+ rack-test (>= 0.6.3)
25
+ rails-dom-testing (~> 2.0)
26
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
+ actionview (5.2.4.4)
28
+ activesupport (= 5.2.4.4)
29
+ builder (~> 3.1)
30
+ erubi (~> 1.4)
31
+ rails-dom-testing (~> 2.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.4.4)
34
+ activesupport (= 5.2.4.4)
35
+ globalid (>= 0.3.6)
36
+ activemodel (5.2.4.4)
37
+ activesupport (= 5.2.4.4)
38
+ activerecord (5.2.4.4)
39
+ activemodel (= 5.2.4.4)
40
+ activesupport (= 5.2.4.4)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.4.4)
43
+ actionpack (= 5.2.4.4)
44
+ activerecord (= 5.2.4.4)
45
+ marcel (~> 0.3.1)
46
+ activesupport (5.2.4.4)
47
+ concurrent-ruby (~> 1.0, >= 1.0.2)
48
+ i18n (>= 0.7, < 2)
49
+ minitest (~> 5.1)
50
+ tzinfo (~> 1.1)
51
+ addressable (2.7.0)
52
+ public_suffix (>= 2.0.2, < 5.0)
53
+ appraisal (2.3.0)
54
+ bundler
55
+ rake
56
+ thor (>= 0.14.0)
57
+ arel (9.0.0)
58
+ ast (2.4.1)
59
+ axiom-types (0.1.1)
60
+ descendants_tracker (~> 0.0.4)
61
+ ice_nine (~> 0.11.0)
62
+ thread_safe (~> 0.3, >= 0.3.1)
63
+ builder (3.2.4)
64
+ coercible (1.0.0)
65
+ descendants_tracker (~> 0.0.1)
66
+ concurrent-ruby (1.1.7)
67
+ crass (1.0.6)
68
+ descendants_tracker (0.0.4)
69
+ thread_safe (~> 0.3, >= 0.3.1)
70
+ diff-lcs (1.4.4)
71
+ docile (1.3.2)
72
+ equalizer (0.0.11)
73
+ erubi (1.9.0)
74
+ erubis (2.7.0)
75
+ flay (2.12.1)
76
+ erubis (~> 2.7.0)
77
+ path_expander (~> 1.0)
78
+ ruby_parser (~> 3.0)
79
+ sexp_processor (~> 4.0)
80
+ flog (4.6.4)
81
+ path_expander (~> 1.0)
82
+ ruby_parser (~> 3.1, > 3.1.0)
83
+ sexp_processor (~> 4.8)
84
+ globalid (0.4.2)
85
+ activesupport (>= 4.2.0)
86
+ i18n (1.8.5)
87
+ concurrent-ruby (~> 1.0)
88
+ ice_nine (0.11.2)
89
+ kwalify (0.7.2)
90
+ launchy (2.5.0)
91
+ addressable (~> 2.7)
92
+ loofah (2.7.0)
93
+ crass (~> 1.0.2)
94
+ nokogiri (>= 1.5.9)
95
+ mail (2.7.1)
96
+ mini_mime (>= 0.1.1)
97
+ marcel (0.3.3)
98
+ mimemagic (~> 0.3.2)
99
+ method_source (1.0.0)
100
+ mimemagic (0.3.5)
101
+ mini_mime (1.0.2)
102
+ mini_portile2 (2.4.0)
103
+ minitest (5.14.2)
104
+ nio4r (2.5.4)
105
+ nokogiri (1.10.10)
106
+ mini_portile2 (~> 2.4.0)
107
+ parallel (1.19.2)
108
+ parser (2.7.2.0)
109
+ ast (~> 2.4.1)
110
+ path_expander (1.1.0)
111
+ psych (3.1.0)
112
+ public_suffix (4.0.6)
113
+ rack (2.2.3)
114
+ rack-test (1.1.0)
115
+ rack (>= 1.0, < 3)
116
+ rails (5.2.4.4)
117
+ actioncable (= 5.2.4.4)
118
+ actionmailer (= 5.2.4.4)
119
+ actionpack (= 5.2.4.4)
120
+ actionview (= 5.2.4.4)
121
+ activejob (= 5.2.4.4)
122
+ activemodel (= 5.2.4.4)
123
+ activerecord (= 5.2.4.4)
124
+ activestorage (= 5.2.4.4)
125
+ activesupport (= 5.2.4.4)
126
+ bundler (>= 1.3.0)
127
+ railties (= 5.2.4.4)
128
+ sprockets-rails (>= 2.0.0)
129
+ rails-dom-testing (2.0.3)
130
+ activesupport (>= 4.2.0)
131
+ nokogiri (>= 1.6)
132
+ rails-html-sanitizer (1.3.0)
133
+ loofah (~> 2.3)
134
+ railties (5.2.4.4)
135
+ actionpack (= 5.2.4.4)
136
+ activesupport (= 5.2.4.4)
137
+ method_source
138
+ rake (>= 0.8.7)
139
+ thor (>= 0.19.0, < 2.0)
140
+ rainbow (3.0.0)
141
+ rake (13.0.1)
142
+ reek (6.0.1)
143
+ kwalify (~> 0.7.0)
144
+ parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
145
+ psych (~> 3.1.0)
146
+ rainbow (>= 2.0, < 4.0)
147
+ regexp_parser (1.8.2)
148
+ rexml (3.2.4)
149
+ rspec (3.10.0)
150
+ rspec-core (~> 3.10.0)
151
+ rspec-expectations (~> 3.10.0)
152
+ rspec-mocks (~> 3.10.0)
153
+ rspec-core (3.10.0)
154
+ rspec-support (~> 3.10.0)
155
+ rspec-expectations (3.10.0)
156
+ diff-lcs (>= 1.2.0, < 2.0)
157
+ rspec-support (~> 3.10.0)
158
+ rspec-mocks (3.10.0)
159
+ diff-lcs (>= 1.2.0, < 2.0)
160
+ rspec-support (~> 3.10.0)
161
+ rspec-support (3.10.0)
162
+ rubocop (0.93.1)
163
+ parallel (~> 1.10)
164
+ parser (>= 2.7.1.5)
165
+ rainbow (>= 2.2.2, < 4.0)
166
+ regexp_parser (>= 1.8)
167
+ rexml
168
+ rubocop-ast (>= 0.6.0)
169
+ ruby-progressbar (~> 1.7)
170
+ unicode-display_width (>= 1.4.0, < 2.0)
171
+ rubocop-ast (1.1.0)
172
+ parser (>= 2.7.1.5)
173
+ rubocop-performance (1.8.1)
174
+ rubocop (>= 0.87.0)
175
+ rubocop-ast (>= 0.4.0)
176
+ rubocop-rspec (1.44.1)
177
+ rubocop (~> 0.87)
178
+ rubocop-ast (>= 0.7.1)
179
+ ruby-progressbar (1.10.1)
180
+ ruby_parser (3.15.0)
181
+ sexp_processor (~> 4.9)
182
+ rubycritic (4.5.2)
183
+ flay (~> 2.8)
184
+ flog (~> 4.4)
185
+ launchy (>= 2.0.0)
186
+ parser (>= 2.6.0)
187
+ rainbow (~> 3.0)
188
+ reek (~> 6.0, < 7.0)
189
+ ruby_parser (~> 3.8)
190
+ simplecov (>= 0.17.0)
191
+ tty-which (~> 0.4.0)
192
+ virtus (~> 1.0)
193
+ sexp_processor (4.15.1)
194
+ simplecov (0.19.0)
195
+ docile (~> 1.1)
196
+ simplecov-html (~> 0.11)
197
+ simplecov-html (0.12.3)
198
+ sprockets (4.0.2)
199
+ concurrent-ruby (~> 1.0)
200
+ rack (> 1, < 3)
201
+ sprockets-rails (3.2.2)
202
+ actionpack (>= 4.0)
203
+ activesupport (>= 4.0)
204
+ sprockets (>= 3.0.0)
205
+ thor (1.0.1)
206
+ thread_safe (0.3.6)
207
+ tty-which (0.4.2)
208
+ tzinfo (1.2.7)
209
+ thread_safe (~> 0.1)
210
+ unicode-display_width (1.7.0)
211
+ virtus (1.0.5)
212
+ axiom-types (~> 0.1)
213
+ coercible (~> 1.0)
214
+ descendants_tracker (~> 0.0, >= 0.0.3)
215
+ equalizer (~> 0.0, >= 0.0.9)
216
+ websocket-driver (0.7.3)
217
+ websocket-extensions (>= 0.1.0)
218
+ websocket-extensions (0.1.5)
219
+
220
+ PLATFORMS
221
+ ruby
222
+
223
+ DEPENDENCIES
224
+ appraisal (~> 2.3)
225
+ rails (= 5.2.4.4)
226
+ rake (~> 13.0)
227
+ rspec (>= 3.10, < 4.0)
228
+ rubocop (~> 0.93)
229
+ rubocop-performance (~> 1.8)
230
+ rubocop-rspec (~> 1.44)
231
+ rubycritic (~> 4.5)
232
+ simplecov (~> 0.19)
233
+ tdc!
234
+
235
+ BUNDLED WITH
236
+ 2.1.4
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "6.0.3.4"
6
+
7
+ gemspec path: "../"
@@ -0,0 +1,252 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ tdc (0.4.6.1)
5
+ activesupport (>= 5.2.4, < 6.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.0.3.4)
11
+ actionpack (= 6.0.3.4)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailbox (6.0.3.4)
15
+ actionpack (= 6.0.3.4)
16
+ activejob (= 6.0.3.4)
17
+ activerecord (= 6.0.3.4)
18
+ activestorage (= 6.0.3.4)
19
+ activesupport (= 6.0.3.4)
20
+ mail (>= 2.7.1)
21
+ actionmailer (6.0.3.4)
22
+ actionpack (= 6.0.3.4)
23
+ actionview (= 6.0.3.4)
24
+ activejob (= 6.0.3.4)
25
+ mail (~> 2.5, >= 2.5.4)
26
+ rails-dom-testing (~> 2.0)
27
+ actionpack (6.0.3.4)
28
+ actionview (= 6.0.3.4)
29
+ activesupport (= 6.0.3.4)
30
+ rack (~> 2.0, >= 2.0.8)
31
+ rack-test (>= 0.6.3)
32
+ rails-dom-testing (~> 2.0)
33
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
34
+ actiontext (6.0.3.4)
35
+ actionpack (= 6.0.3.4)
36
+ activerecord (= 6.0.3.4)
37
+ activestorage (= 6.0.3.4)
38
+ activesupport (= 6.0.3.4)
39
+ nokogiri (>= 1.8.5)
40
+ actionview (6.0.3.4)
41
+ activesupport (= 6.0.3.4)
42
+ builder (~> 3.1)
43
+ erubi (~> 1.4)
44
+ rails-dom-testing (~> 2.0)
45
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
46
+ activejob (6.0.3.4)
47
+ activesupport (= 6.0.3.4)
48
+ globalid (>= 0.3.6)
49
+ activemodel (6.0.3.4)
50
+ activesupport (= 6.0.3.4)
51
+ activerecord (6.0.3.4)
52
+ activemodel (= 6.0.3.4)
53
+ activesupport (= 6.0.3.4)
54
+ activestorage (6.0.3.4)
55
+ actionpack (= 6.0.3.4)
56
+ activejob (= 6.0.3.4)
57
+ activerecord (= 6.0.3.4)
58
+ marcel (~> 0.3.1)
59
+ activesupport (6.0.3.4)
60
+ concurrent-ruby (~> 1.0, >= 1.0.2)
61
+ i18n (>= 0.7, < 2)
62
+ minitest (~> 5.1)
63
+ tzinfo (~> 1.1)
64
+ zeitwerk (~> 2.2, >= 2.2.2)
65
+ addressable (2.7.0)
66
+ public_suffix (>= 2.0.2, < 5.0)
67
+ appraisal (2.3.0)
68
+ bundler
69
+ rake
70
+ thor (>= 0.14.0)
71
+ ast (2.4.1)
72
+ axiom-types (0.1.1)
73
+ descendants_tracker (~> 0.0.4)
74
+ ice_nine (~> 0.11.0)
75
+ thread_safe (~> 0.3, >= 0.3.1)
76
+ builder (3.2.4)
77
+ coercible (1.0.0)
78
+ descendants_tracker (~> 0.0.1)
79
+ concurrent-ruby (1.1.7)
80
+ crass (1.0.6)
81
+ descendants_tracker (0.0.4)
82
+ thread_safe (~> 0.3, >= 0.3.1)
83
+ diff-lcs (1.4.4)
84
+ docile (1.3.2)
85
+ equalizer (0.0.11)
86
+ erubi (1.9.0)
87
+ erubis (2.7.0)
88
+ flay (2.12.1)
89
+ erubis (~> 2.7.0)
90
+ path_expander (~> 1.0)
91
+ ruby_parser (~> 3.0)
92
+ sexp_processor (~> 4.0)
93
+ flog (4.6.4)
94
+ path_expander (~> 1.0)
95
+ ruby_parser (~> 3.1, > 3.1.0)
96
+ sexp_processor (~> 4.8)
97
+ globalid (0.4.2)
98
+ activesupport (>= 4.2.0)
99
+ i18n (1.8.5)
100
+ concurrent-ruby (~> 1.0)
101
+ ice_nine (0.11.2)
102
+ kwalify (0.7.2)
103
+ launchy (2.5.0)
104
+ addressable (~> 2.7)
105
+ loofah (2.7.0)
106
+ crass (~> 1.0.2)
107
+ nokogiri (>= 1.5.9)
108
+ mail (2.7.1)
109
+ mini_mime (>= 0.1.1)
110
+ marcel (0.3.3)
111
+ mimemagic (~> 0.3.2)
112
+ method_source (1.0.0)
113
+ mimemagic (0.3.5)
114
+ mini_mime (1.0.2)
115
+ mini_portile2 (2.4.0)
116
+ minitest (5.14.2)
117
+ nio4r (2.5.4)
118
+ nokogiri (1.10.10)
119
+ mini_portile2 (~> 2.4.0)
120
+ parallel (1.19.2)
121
+ parser (2.7.2.0)
122
+ ast (~> 2.4.1)
123
+ path_expander (1.1.0)
124
+ psych (3.1.0)
125
+ public_suffix (4.0.6)
126
+ rack (2.2.3)
127
+ rack-test (1.1.0)
128
+ rack (>= 1.0, < 3)
129
+ rails (6.0.3.4)
130
+ actioncable (= 6.0.3.4)
131
+ actionmailbox (= 6.0.3.4)
132
+ actionmailer (= 6.0.3.4)
133
+ actionpack (= 6.0.3.4)
134
+ actiontext (= 6.0.3.4)
135
+ actionview (= 6.0.3.4)
136
+ activejob (= 6.0.3.4)
137
+ activemodel (= 6.0.3.4)
138
+ activerecord (= 6.0.3.4)
139
+ activestorage (= 6.0.3.4)
140
+ activesupport (= 6.0.3.4)
141
+ bundler (>= 1.3.0)
142
+ railties (= 6.0.3.4)
143
+ sprockets-rails (>= 2.0.0)
144
+ rails-dom-testing (2.0.3)
145
+ activesupport (>= 4.2.0)
146
+ nokogiri (>= 1.6)
147
+ rails-html-sanitizer (1.3.0)
148
+ loofah (~> 2.3)
149
+ railties (6.0.3.4)
150
+ actionpack (= 6.0.3.4)
151
+ activesupport (= 6.0.3.4)
152
+ method_source
153
+ rake (>= 0.8.7)
154
+ thor (>= 0.20.3, < 2.0)
155
+ rainbow (3.0.0)
156
+ rake (13.0.1)
157
+ reek (6.0.1)
158
+ kwalify (~> 0.7.0)
159
+ parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
160
+ psych (~> 3.1.0)
161
+ rainbow (>= 2.0, < 4.0)
162
+ regexp_parser (1.8.2)
163
+ rexml (3.2.4)
164
+ rspec (3.10.0)
165
+ rspec-core (~> 3.10.0)
166
+ rspec-expectations (~> 3.10.0)
167
+ rspec-mocks (~> 3.10.0)
168
+ rspec-core (3.10.0)
169
+ rspec-support (~> 3.10.0)
170
+ rspec-expectations (3.10.0)
171
+ diff-lcs (>= 1.2.0, < 2.0)
172
+ rspec-support (~> 3.10.0)
173
+ rspec-mocks (3.10.0)
174
+ diff-lcs (>= 1.2.0, < 2.0)
175
+ rspec-support (~> 3.10.0)
176
+ rspec-support (3.10.0)
177
+ rubocop (0.93.1)
178
+ parallel (~> 1.10)
179
+ parser (>= 2.7.1.5)
180
+ rainbow (>= 2.2.2, < 4.0)
181
+ regexp_parser (>= 1.8)
182
+ rexml
183
+ rubocop-ast (>= 0.6.0)
184
+ ruby-progressbar (~> 1.7)
185
+ unicode-display_width (>= 1.4.0, < 2.0)
186
+ rubocop-ast (1.1.0)
187
+ parser (>= 2.7.1.5)
188
+ rubocop-performance (1.8.1)
189
+ rubocop (>= 0.87.0)
190
+ rubocop-ast (>= 0.4.0)
191
+ rubocop-rspec (1.44.1)
192
+ rubocop (~> 0.87)
193
+ rubocop-ast (>= 0.7.1)
194
+ ruby-progressbar (1.10.1)
195
+ ruby_parser (3.15.0)
196
+ sexp_processor (~> 4.9)
197
+ rubycritic (4.5.2)
198
+ flay (~> 2.8)
199
+ flog (~> 4.4)
200
+ launchy (>= 2.0.0)
201
+ parser (>= 2.6.0)
202
+ rainbow (~> 3.0)
203
+ reek (~> 6.0, < 7.0)
204
+ ruby_parser (~> 3.8)
205
+ simplecov (>= 0.17.0)
206
+ tty-which (~> 0.4.0)
207
+ virtus (~> 1.0)
208
+ sexp_processor (4.15.1)
209
+ simplecov (0.19.0)
210
+ docile (~> 1.1)
211
+ simplecov-html (~> 0.11)
212
+ simplecov-html (0.12.3)
213
+ sprockets (4.0.2)
214
+ concurrent-ruby (~> 1.0)
215
+ rack (> 1, < 3)
216
+ sprockets-rails (3.2.2)
217
+ actionpack (>= 4.0)
218
+ activesupport (>= 4.0)
219
+ sprockets (>= 3.0.0)
220
+ thor (1.0.1)
221
+ thread_safe (0.3.6)
222
+ tty-which (0.4.2)
223
+ tzinfo (1.2.7)
224
+ thread_safe (~> 0.1)
225
+ unicode-display_width (1.7.0)
226
+ virtus (1.0.5)
227
+ axiom-types (~> 0.1)
228
+ coercible (~> 1.0)
229
+ descendants_tracker (~> 0.0, >= 0.0.3)
230
+ equalizer (~> 0.0, >= 0.0.9)
231
+ websocket-driver (0.7.3)
232
+ websocket-extensions (>= 0.1.0)
233
+ websocket-extensions (0.1.5)
234
+ zeitwerk (2.4.1)
235
+
236
+ PLATFORMS
237
+ ruby
238
+
239
+ DEPENDENCIES
240
+ appraisal (~> 2.3)
241
+ rails (= 6.0.3.4)
242
+ rake (~> 13.0)
243
+ rspec (>= 3.10, < 4.0)
244
+ rubocop (~> 0.93)
245
+ rubocop-performance (~> 1.8)
246
+ rubocop-rspec (~> 1.44)
247
+ rubycritic (~> 4.5)
248
+ simplecov (~> 0.19)
249
+ tdc!
250
+
251
+ BUNDLED WITH
252
+ 2.1.4
data/lib/tdc.rb CHANGED
@@ -41,6 +41,14 @@ require "tdc/generators/definition_sourcable"
41
41
  require "tdc/generators/generator_base"
42
42
  require "tdc/generators/standard_generator"
43
43
 
44
+ # YAML Readers
45
+ require "tdc/yaml_readers"
46
+ require "tdc/yaml_readers/null_yaml_reader"
47
+ require "tdc/yaml_readers/yaml_reader_base"
48
+ require "tdc/yaml_readers/yaml_reader"
49
+ require "tdc/yaml_readers/yaml_reader_with_expansion"
50
+ require "tdc/yaml_readers/yaml_reader_factory"
51
+
44
52
  #
45
53
  # A framework for building a Test Data Catalog
46
54
  #
@@ -5,45 +5,16 @@ module Tdc
5
5
  class DataDefinitionFileReader < Tdc::DataDefinition
6
6
  EMPTY_DEFINITIONS = []
7
7
 
8
- def initialize(catalog_root_directory)
9
- super()
8
+ attr_reader :catalog_root_directory
10
9
 
10
+ def initialize(catalog_root_directory)
11
11
  @catalog_root_directory = catalog_root_directory
12
12
  end
13
13
 
14
14
  def read(*path_elements)
15
- data_definition_from(definitions_file(path_elements))
16
- end
17
-
18
- private
19
-
20
- def definitions_file(path_elements)
21
- fully_qualified_path_elements = [@catalog_root_directory].concat(path_elements.map(&:to_s))
22
-
23
- fully_qualified_path_elements.last.concat(".yml")
24
-
25
- File.join(*fully_qualified_path_elements)
26
- end
27
-
28
- def data_definition_from(definitions_file)
29
- if File.exist?(definitions_file)
30
- load_yaml(definitions_file) || EMPTY_DEFINITIONS
31
- else
32
- EMPTY_DEFINITIONS
33
- end
34
- end
35
-
36
- def load_yaml(definitions_file)
37
- YAML.load(expand_erb(definitions_file)) # rubocop:disable Security/YAMLLoad
38
- rescue => e
39
- raise Tdc::FatalError, <<~MSG
40
- Unable to load YAML from #{definitions_file}
41
- Cause: #{e.message}"
42
- MSG
43
- end
15
+ reader = Tdc::YamlReaders::YamlReaderFactory.new(@catalog_root_directory, path_elements).create
44
16
 
45
- def expand_erb(definitions_file)
46
- ERB.new(File.read(definitions_file)).result
17
+ reader.data_definitions
47
18
  end
48
19
  end
49
20
  end
@@ -8,8 +8,6 @@ module Tdc
8
8
  attr_reader :key, :source
9
9
 
10
10
  def initialize(key:, source:)
11
- super()
12
-
13
11
  @key = key
14
12
  @source = source
15
13
  end
@@ -26,15 +24,23 @@ module Tdc
26
24
  # Use the tag to source an object from the current catalog.
27
25
  sourced_object = catalog_entry.send(tag)
28
26
 
29
- unless sourced_object
30
- message = "Could not find a tag reference for '#{key}' in the catalog entries provided."
31
-
32
- raise Tdc::FatalError, message
33
- end
27
+ unresolvable_tag(tag, catalog_entry) unless sourced_object
34
28
 
35
29
  # Replace the tag value with the sourced object.
36
30
  instance_definition[key] = sourced_object
37
31
  end
32
+
33
+ private
34
+
35
+ def unresolvable_tag(tag, catalog_entry)
36
+ source_tags = catalog_entry.entries.sort.map { |entry| "'#{entry}'" }.to_sentence
37
+
38
+ raise Tdc::FatalError, <<~MESSAGE
39
+ Could not resolve key '#{key}' from source '#{source}'.
40
+
41
+ Attempted to resolve tag '#{tag}' from these tags: #{source_tags}
42
+ MESSAGE
43
+ end
38
44
  end
39
45
  end
40
46
  end
@@ -14,6 +14,10 @@ module Tdc
14
14
  @interpreters = []
15
15
  end
16
16
 
17
+ def clear
18
+ @interpreters = []
19
+ end
20
+
17
21
  def interpreters
18
22
  @interpreters.empty? ? [default_interpreter] : @interpreters
19
23
  end
@@ -23,6 +27,9 @@ module Tdc
23
27
  Cannot register an interpreter unless it inherits from Tdc::ExtendedAttributes::InterpreterBase
24
28
  MSG
25
29
 
30
+ # Avoid registering the same class of interpreter a second time.
31
+ return if @interpreters.map(&:class).include?(interpreter.class)
32
+
26
33
  @interpreters << interpreter
27
34
  end
28
35
 
@@ -1,7 +1,4 @@
1
1
  module Tdc
2
2
  class FatalError < RuntimeError
3
- def initialize(msg = nil)
4
- super
5
- end
6
3
  end
7
4
  end
@@ -13,6 +13,10 @@ module Tdc
13
13
  to_h.empty?
14
14
  end
15
15
 
16
+ def entries
17
+ to_h.keys
18
+ end
19
+
16
20
  def first
17
21
  to_h.first&.second
18
22
  end
@@ -46,7 +46,7 @@ module Tdc
46
46
  end
47
47
  end
48
48
 
49
- def respond_to_missing?(method, include_all = false) # rubocop:disable Style/OptionalBooleanParameter
49
+ def respond_to_missing?(method, include_all = false)
50
50
  ghost_definition?(method) || ghost_optional_definition?(method) ? true : super
51
51
  end
52
52
 
@@ -4,8 +4,6 @@ module Tdc
4
4
  #
5
5
  class InMemoryDataDefinition < Tdc::DataDefinition
6
6
  def initialize(path_elements_data = {})
7
- super()
8
-
9
7
  @store = path_elements_data
10
8
  end
11
9
 
@@ -1,3 +1,3 @@
1
1
  module Tdc
2
- VERSION = "0.4.3.1"
2
+ VERSION = "0.4.7"
3
3
  end
@@ -0,0 +1,7 @@
1
+ module Tdc
2
+ #
3
+ # Namespace to host YAML readers.
4
+ #
5
+ module YamlReaders
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ module Tdc
2
+ module YamlReaders
3
+ #
4
+ # When we can't find a YAML source.
5
+ #
6
+ class NullYamlReader
7
+ def data_definitions
8
+ []
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ module Tdc
2
+ module YamlReaders
3
+ #
4
+ # YAML source is a YAML file.
5
+ #
6
+ class YamlReader < Tdc::YamlReaders::YamlReaderBase
7
+ def file_extension
8
+ ".yml"
9
+ end
10
+
11
+ def source_string
12
+ File.read(definitions_file)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,52 @@
1
+ module Tdc
2
+ module YamlReaders
3
+ #
4
+ # YAML source.
5
+ #
6
+ class YamlReaderBase
7
+ def initialize(catalog_root_directory, path_elements)
8
+ @catalog_root_directory = catalog_root_directory
9
+ @path_elements = path_elements
10
+ end
11
+
12
+ def applies?
13
+ File.exist?(definitions_file)
14
+ end
15
+
16
+ def data_definitions
17
+ definitions_source
18
+ end
19
+
20
+ def definitions_source
21
+ source_string.empty? ? [] : YAML.load(source_string) # rubocop:disable Security/YAMLLoad
22
+ rescue => e
23
+ raise Tdc::FatalError, <<~MSG
24
+ Unable to load YAML from #{definitions_file}
25
+ Cause: #{e.message}"
26
+ MSG
27
+ end
28
+
29
+ concerning :HookMethods do
30
+ def file_extension
31
+ raise MissingOverrideError, "Implement the 'file_extension' method"
32
+ end
33
+
34
+ def source_string
35
+ raise MissingOverrideError, "Implement the 'source_string' method"
36
+ end
37
+ end
38
+
39
+ private
40
+
41
+ def definitions_file
42
+ @_definitions_file ||= begin
43
+ fully_qualified_path_elements = [@catalog_root_directory].concat(@path_elements.map(&:to_s))
44
+
45
+ fully_qualified_path_elements.last.concat(file_extension)
46
+
47
+ File.join(*fully_qualified_path_elements)
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,38 @@
1
+ module Tdc
2
+ module YamlReaders
3
+ #
4
+ # Knows how to create the appropriate YAML reader.
5
+ #
6
+ class YamlReaderFactory
7
+ def initialize(catalog_root_directory, path_elements)
8
+ @catalog_root_directory = catalog_root_directory
9
+ @path_elements = path_elements
10
+ end
11
+
12
+ def create
13
+ if yaml_reader_with_expansion.applies?
14
+ yaml_reader_with_expansion
15
+ elsif yaml_reader.applies?
16
+ yaml_reader
17
+ else
18
+ null_reader
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def yaml_reader_with_expansion
25
+ @_yaml_reader_with_expansion ||=
26
+ Tdc::YamlReaders::YamlReaderWithExpansion.new(@catalog_root_directory, @path_elements)
27
+ end
28
+
29
+ def null_reader
30
+ @_null_reader ||= Tdc::YamlReaders::NullYamlReader.new
31
+ end
32
+
33
+ def yaml_reader
34
+ @_yaml_reader ||= Tdc::YamlReaders::YamlReader.new(@catalog_root_directory, @path_elements)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,16 @@
1
+ module Tdc
2
+ module YamlReaders
3
+ #
4
+ # YAML source is a YAML file that undergoes ERB expansion.
5
+ #
6
+ class YamlReaderWithExpansion < Tdc::YamlReaders::YamlReaderBase
7
+ def file_extension
8
+ ".yml.erb"
9
+ end
10
+
11
+ def source_string
12
+ ERB.new(File.read(definitions_file)).result
13
+ end
14
+ end
15
+ end
16
+ end
@@ -28,11 +28,14 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_runtime_dependency "activesupport", "~> 5.2.4"
31
+ spec.add_runtime_dependency "activesupport", ">= 5.2.4", "< 6.1"
32
32
 
33
- spec.add_development_dependency "rake", ">= 12.1", "< 13.1"
34
- spec.add_development_dependency "rspec", ">= 3.9", "< 4.0"
35
- spec.add_development_dependency "rubocop", "~> 0.89"
36
- spec.add_development_dependency "rubocop-rspec", "~> 1.42"
37
- spec.add_development_dependency "simplecov", "~> 0.17"
33
+ spec.add_development_dependency "appraisal", "~> 2.3"
34
+ spec.add_development_dependency "rake", "~> 13.0"
35
+ spec.add_development_dependency "rspec", ">= 3.10", "< 4.0"
36
+ spec.add_development_dependency "rubocop", "~> 0.93"
37
+ spec.add_development_dependency "rubocop-performance", "~> 1.8"
38
+ spec.add_development_dependency "rubocop-rspec", "~> 1.44"
39
+ spec.add_development_dependency "rubycritic", "~> 4.5"
40
+ spec.add_development_dependency "simplecov", "~> 0.19"
38
41
  end
metadata CHANGED
@@ -1,56 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3.1
4
+ version: 0.4.7
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-25 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 5.2.4
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6.1'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 5.2.4
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.1'
27
33
  - !ruby/object:Gem::Dependency
28
- name: rake
34
+ name: appraisal
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '12.1'
34
- - - "<"
37
+ - - "~>"
35
38
  - !ruby/object:Gem::Version
36
- version: '13.1'
39
+ version: '2.3'
37
40
  type: :development
38
41
  prerelease: false
39
42
  version_requirements: !ruby/object:Gem::Requirement
40
43
  requirements:
41
- - - ">="
44
+ - - "~>"
42
45
  - !ruby/object:Gem::Version
43
- version: '12.1'
44
- - - "<"
46
+ version: '2.3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
45
52
  - !ruby/object:Gem::Version
46
- version: '13.1'
53
+ version: '13.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '13.0'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: rspec
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - ">="
52
66
  - !ruby/object:Gem::Version
53
- version: '3.9'
67
+ version: '3.10'
54
68
  - - "<"
55
69
  - !ruby/object:Gem::Version
56
70
  version: '4.0'
@@ -60,7 +74,7 @@ dependencies:
60
74
  requirements:
61
75
  - - ">="
62
76
  - !ruby/object:Gem::Version
63
- version: '3.9'
77
+ version: '3.10'
64
78
  - - "<"
65
79
  - !ruby/object:Gem::Version
66
80
  version: '4.0'
@@ -70,42 +84,70 @@ dependencies:
70
84
  requirements:
71
85
  - - "~>"
72
86
  - !ruby/object:Gem::Version
73
- version: '0.89'
87
+ version: '0.93'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '0.93'
95
+ - !ruby/object:Gem::Dependency
96
+ name: rubocop-performance
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '1.8'
74
102
  type: :development
75
103
  prerelease: false
76
104
  version_requirements: !ruby/object:Gem::Requirement
77
105
  requirements:
78
106
  - - "~>"
79
107
  - !ruby/object:Gem::Version
80
- version: '0.89'
108
+ version: '1.8'
81
109
  - !ruby/object:Gem::Dependency
82
110
  name: rubocop-rspec
83
111
  requirement: !ruby/object:Gem::Requirement
84
112
  requirements:
85
113
  - - "~>"
86
114
  - !ruby/object:Gem::Version
87
- version: '1.42'
115
+ version: '1.44'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '1.44'
123
+ - !ruby/object:Gem::Dependency
124
+ name: rubycritic
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '4.5'
88
130
  type: :development
89
131
  prerelease: false
90
132
  version_requirements: !ruby/object:Gem::Requirement
91
133
  requirements:
92
134
  - - "~>"
93
135
  - !ruby/object:Gem::Version
94
- version: '1.42'
136
+ version: '4.5'
95
137
  - !ruby/object:Gem::Dependency
96
138
  name: simplecov
97
139
  requirement: !ruby/object:Gem::Requirement
98
140
  requirements:
99
141
  - - "~>"
100
142
  - !ruby/object:Gem::Version
101
- version: '0.17'
143
+ version: '0.19'
102
144
  type: :development
103
145
  prerelease: false
104
146
  version_requirements: !ruby/object:Gem::Requirement
105
147
  requirements:
106
148
  - - "~>"
107
149
  - !ruby/object:Gem::Version
108
- version: '0.17'
150
+ version: '0.19'
109
151
  description:
110
152
  email:
111
153
  - alistairm@nulogy.com
@@ -118,12 +160,17 @@ files:
118
160
  - ".rspec"
119
161
  - ".rubocop.yml"
120
162
  - ".ruby-version"
163
+ - Appraisals
121
164
  - CHANGELOG.md
122
165
  - Gemfile
123
166
  - README.md
124
167
  - Rakefile
125
168
  - bin/console
126
169
  - bin/setup
170
+ - gemfiles/rails_5.gemfile
171
+ - gemfiles/rails_5.gemfile.lock
172
+ - gemfiles/rails_6.gemfile
173
+ - gemfiles/rails_6.gemfile.lock
127
174
  - images/Tdc.png
128
175
  - lib/tdc.rb
129
176
  - lib/tdc/data_definition.rb
@@ -147,6 +194,12 @@ files:
147
194
  - lib/tdc/missing_override_error.rb
148
195
  - lib/tdc/version.rb
149
196
  - lib/tdc/with_indifferent_access_decorator.rb
197
+ - lib/tdc/yaml_readers.rb
198
+ - lib/tdc/yaml_readers/null_yaml_reader.rb
199
+ - lib/tdc/yaml_readers/yaml_reader.rb
200
+ - lib/tdc/yaml_readers/yaml_reader_base.rb
201
+ - lib/tdc/yaml_readers/yaml_reader_factory.rb
202
+ - lib/tdc/yaml_readers/yaml_reader_with_expansion.rb
150
203
  - tdc.gemspec
151
204
  homepage: https://github.com/nulogy/tdc
152
205
  licenses: