fat_table 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -5
- data/lib/fat_table/table.rb +13 -5
- data/lib/fat_table/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea0adf5d428fa875a7dda51538a79e514b9095b167d392ef06eae849e563a9f
|
4
|
+
data.tar.gz: d5ac2784c1f569fc1677f596278af3c6a00b1b5736ea1a080667f8a0f0acdd16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea35509645ae4c11c8f7fd61157fe5057cf5d11237d888b9e5cfcbab437ff5fd90a3d3cffa9bd6d53038406138b12a890c65a72a59ac0b9542c1a90a979158c
|
7
|
+
data.tar.gz: 04eaf2e05b452efc8f25c14ab51b069d09dd9c548983481731562883d8866beac555a4a48a85b3352d408736c1b22d90881c0a23fab273fd78b459f31f704988
|
data/.rubocop.yml
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require: rubocop-rspec
|
4
|
-
require: rubocop-performance
|
1
|
+
inherit_from:
|
2
|
+
- ~/.rubocop.yml
|
5
3
|
|
6
4
|
AllCops:
|
7
|
-
TargetRubyVersion: 2.7
|
8
5
|
Exclude:
|
9
6
|
- 'test/tmp/**/*'
|
10
7
|
- 'vendor/bundle/**/*'
|
@@ -12,6 +9,7 @@ AllCops:
|
|
12
9
|
Style/MethodCallWithArgsParentheses:
|
13
10
|
Exclude:
|
14
11
|
- '**/Gemfile'
|
12
|
+
- '*_spec.rb'
|
15
13
|
|
16
14
|
Style/ClassAndModuleChildren:
|
17
15
|
Exclude:
|
data/lib/fat_table/table.rb
CHANGED
@@ -1304,12 +1304,20 @@ module FatTable
|
|
1304
1304
|
# is set true, mark this row as a boundary. All tables should be built
|
1305
1305
|
# ultimately using this method as a primitive.
|
1306
1306
|
def add_row(row, mark: false)
|
1307
|
-
row.
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1307
|
+
row.transform_keys!(&:as_sym)
|
1308
|
+
# Make sure there is a column for each known header and each new key
|
1309
|
+
# present in row.
|
1310
|
+
new_heads = row.keys - headers
|
1311
|
+
new_heads.each do |h|
|
1312
|
+
# This column is new, so it needs nil items for all prior rows lest
|
1313
|
+
# the value be added to a prior row.
|
1314
|
+
items = Array.new(size, nil)
|
1315
|
+
columns << Column.new(header: h, items: items)
|
1316
|
+
end
|
1317
|
+
headers.each do |h|
|
1318
|
+
# NB: This adds a nil if h is not in row.
|
1319
|
+
column(h) << row[h]
|
1311
1320
|
end
|
1312
|
-
add_boundary if mark
|
1313
1321
|
self
|
1314
1322
|
end
|
1315
1323
|
|
data/lib/fat_table/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel E. Doherty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|