fixture_fox 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fixture_fox.gemspec +2 -1
- data/lib/fixture_fox/analyzer.rb +12 -12
- data/lib/fixture_fox/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7581c59d3d7efa1d8f559da1031eefa8cbefdf86bf248a752010d654fbaf25de
|
4
|
+
data.tar.gz: a70b6e9af1d19d61f694a038dd75551e460f801b2b5a5c26bbc075e5ee8cdbe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea176e378870d9e6d4870273de052711ee9a32e832c34ca9d7405650bc3bf8b671ef960cee325e26aff62202fe145ccd498dd9726a5949778387621295a67484
|
7
|
+
data.tar.gz: 488630dcc4b7e5fe656fe3b23a5015002e38b8a3b84d653fcfe30b903f12bbdca3da05cebcaee2fa21975d0e07e3cf93b653538294505bf87429730a607103ae
|
data/fixture_fox.gemspec
CHANGED
@@ -28,7 +28,8 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency "developer_exceptions"
|
29
29
|
spec.add_dependency "constrain"
|
30
30
|
|
31
|
-
|
31
|
+
# spec.add_dependency "shellopts", '=2.1.3'
|
32
|
+
spec.add_dependency "shellopts"
|
32
33
|
spec.add_dependency "pg_graph"
|
33
34
|
|
34
35
|
spec.add_development_dependency "rake"
|
data/lib/fixture_fox/analyzer.rb
CHANGED
@@ -196,7 +196,7 @@ module FixtureFox
|
|
196
196
|
ast_ref.reference.error("Can't find anchor for reference '#{ast_ref.reference.litt}'")
|
197
197
|
anchor_types =
|
198
198
|
[anchor.type] +
|
199
|
-
(anchor.type.table.
|
199
|
+
(anchor.type.table.sub_table? ? [anchor.type.table.super_table.record_type] : [])
|
200
200
|
anchor_types.any? { |anchor_type| ast_ref.type == anchor_type } or
|
201
201
|
ast_ref.reference.error(
|
202
202
|
"Data type mismatch - expected a reference to a " \
|
@@ -213,23 +213,23 @@ module FixtureFox
|
|
213
213
|
def generate_record_ids
|
214
214
|
# puts "generate_record_ids"
|
215
215
|
# puts " ids: #{@ids}"
|
216
|
-
@
|
216
|
+
@super_table_records = [] # Array of pairs of super_table/id
|
217
217
|
records.each { |ast_record|
|
218
218
|
table = ast_record.type.table
|
219
|
-
table_uid = table.
|
219
|
+
table_uid = table.sub_table? ? table.super_table.uid : table.uid
|
220
220
|
|
221
|
-
# If enclosing record/table is the
|
222
|
-
if table.
|
221
|
+
# If enclosing record/table is the super_table, then take the ID from there
|
222
|
+
if table.sub_table?
|
223
223
|
parent_table = ast_record.parent.type.table
|
224
|
-
if table.
|
224
|
+
if table.super_table == parent_table # works for both Record and Table objects
|
225
225
|
id = @ids[table.uid] = @ids[parent_table.uid]
|
226
226
|
|
227
|
-
# Enclosing record/table is not the
|
228
|
-
# based on the current
|
227
|
+
# Enclosing record/table is not the super_table so generate a new ID
|
228
|
+
# based on the current super_table ID and prepare a new super_table
|
229
229
|
# record
|
230
230
|
else
|
231
|
-
id = @ids[table.uid] = @ids[table.
|
232
|
-
@
|
231
|
+
id = @ids[table.uid] = @ids[table.super_table.uid] += 1
|
232
|
+
@super_table_records << [table.super_table, id]
|
233
233
|
end
|
234
234
|
ast_record.id = id
|
235
235
|
|
@@ -261,8 +261,8 @@ module FixtureFox
|
|
261
261
|
# Build all root tables. This makes sure empty tables are registered
|
262
262
|
ast.tables.each { |t| idr.put(t.schema, t.type.table.name) }
|
263
263
|
|
264
|
-
# Create implicit
|
265
|
-
@
|
264
|
+
# Create implicit super_table records
|
265
|
+
@super_table_records.each { |table, id|
|
266
266
|
idr.put(table.schema.name, table.name, id)
|
267
267
|
}
|
268
268
|
|
data/lib/fixture_fox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixture_fox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: shellopts
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: pg_graph
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
- !ruby/object:Gem::Version
|
249
249
|
version: '0'
|
250
250
|
requirements: []
|
251
|
-
rubygems_version: 3.3.
|
251
|
+
rubygems_version: 3.3.18
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: fixture_fox gem
|