fixture_fox 0.2.1 → 0.2.3

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: e69975e35fdcd0bf557d37be7199e9325df926ddbe57e2f037562ed0ae2520ef
4
- data.tar.gz: 9dc890486cf2228674b0bb391c72f983d8eda0b873c808eb9fafb5bb9af0f337
3
+ metadata.gz: 2df98a0f3709e924fc29ae7f8d155191bc5e6e49338e5f6673376f36bf3d0a1f
4
+ data.tar.gz: b578b8fbaeec78c200bc387de6d3cbbfa0a8d468131fea552329bb5088234085
5
5
  SHA512:
6
- metadata.gz: e89727227ce7c19d477ebb7cc3491d7816e1dba0f136ddd412a06e1225365e8b998b3e53f900a7af6449e6b54679a11ea8d36a8b5ce304909eef587aa9412e21
7
- data.tar.gz: 987804670f6a9c18af3d59a5b40a81a8e4f118f2e5122f2fc269276c0fb33b2e65904beac383870efd4e2944c3ebdc461e1e65bb3aa5ef79d0cc950585358c36
6
+ metadata.gz: 7fbb05bacc4362fc47fee303969b9b0e621da953f8b8f9f21e62441121ce89f5ce4784d1242fa38a061d905bf865b1fb3db7b33bb76309eb1ddb2a424076f6ef
7
+ data.tar.gz: 9a7ff187e819d3f7f9ced5755df25382b7da9bb350fb1d9ac788ec8951d19b446b33eaf3cac6bf3883e44eabaff84b9b2b9fbd110e0fda43c479449e1593a24c
@@ -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.subtable? ? [anchor.type.table.supertable.record_type] : [])
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
- @supertable_records = [] # Array of pairs of supertable/id
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.subtable? ? table.supertable.uid : table.uid
219
+ table_uid = table.sub_table? ? table.super_table.uid : table.uid
220
220
 
221
- # If enclosing record/table is the supertable, then take the ID from there
222
- if table.subtable?
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.supertable == parent_table # works for both Record and Table objects
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 supertable so generate a new ID
228
- # based on the current supertable ID and prepare a new supertable
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.supertable.uid] += 1
232
- @supertable_records << [table.supertable, id]
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 supertable records
265
- @supertable_records.each { |table, id|
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
 
@@ -1,3 +1,3 @@
1
1
  module FixtureFox
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.3"
3
3
  end
data/lib/fixture_fox.rb CHANGED
@@ -83,7 +83,7 @@ module FixtureFox
83
83
  def initialize(type, files = [], schema: nil, ids: nil, anchors: nil)
84
84
  constrain type, PgGraph::Type
85
85
  constrain files, [String]
86
- constrain ids, NilClass, String => Integer
86
+ constrain ids, { String => Integer }, nil
87
87
  constrain anchors, Anchors, [Hash], NilClass
88
88
  @type = type
89
89
  @files = []
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.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2023-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -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.7
251
+ rubygems_version: 3.3.18
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: fixture_fox gem