fat_table 0.9.8 → 0.9.9
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 +4 -4
- data/lib/fat_table/formatters/formatter.rb +5 -5
- data/lib/fat_table/formatters/term_formatter.rb +18 -18
- data/lib/fat_table/table.rb +2 -2
- data/lib/fat_table/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e9d5fc6b7d8ff78de97e8bf04024a96039b98e6190fc2ba74fdee278b51f45f
|
4
|
+
data.tar.gz: ced82055dd734b519373417f512ed86b0b081782d82fa62f063143dda5fb8798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16457961d9efa0d6965cd3ff3731a4161d8c0fa22622f9c269a585bbed4d011b03e0398f5c65f1570a2d6c1910f0e0a900b6087223fced276369b04a96cf0627
|
7
|
+
data.tar.gz: 0b32725f560c402f5a867b0d191c0648d889bbde14f122f41ce80cc4f411f60f089c63bb3f1aeab370cc0db2bcfd94b609b6f1806e2a6f2e079019246c7f9b49
|
@@ -729,11 +729,11 @@ module FatTable
|
|
729
729
|
# Parsing and validation routines
|
730
730
|
############################################################################
|
731
731
|
|
732
|
-
private
|
733
|
-
|
734
732
|
# Re to match a color name
|
735
733
|
CLR_RE = /(?:[-_a-zA-Z0-9 ]*)/
|
736
734
|
|
735
|
+
private
|
736
|
+
|
737
737
|
# Return a hash that reflects the formatting instructions given in the
|
738
738
|
# string fmt. Raise an error if it contains invalid formatting instructions.
|
739
739
|
# If fmt contains conflicting instructions, say C and L, there is no
|
@@ -1251,7 +1251,7 @@ module FatTable
|
|
1251
1251
|
map = {}
|
1252
1252
|
table.headers.each do |h|
|
1253
1253
|
istruct = format_at[:header][h]
|
1254
|
-
map[h] = [h, format_cell(h.
|
1254
|
+
map[h] = [h, format_cell(h.entitle, istruct, decorate: decorate)]
|
1255
1255
|
end
|
1256
1256
|
map
|
1257
1257
|
end
|
@@ -1294,7 +1294,7 @@ module FatTable
|
|
1294
1294
|
# Format group footers
|
1295
1295
|
gfooters.each_pair do |_label, gfooter|
|
1296
1296
|
out_rows << nil
|
1297
|
-
gfoot_row = Hash.new([nil, ''])
|
1297
|
+
gfoot_row = Hash.new([nil, ''].freeze)
|
1298
1298
|
gfooter.to_h(grp_k).each_pair do |h, v|
|
1299
1299
|
istruct = format_at[:gfooter][h]
|
1300
1300
|
gfoot_row[h] = [v, format_cell(v, istruct, decorate: decorate)]
|
@@ -1313,7 +1313,7 @@ module FatTable
|
|
1313
1313
|
|
1314
1314
|
footers.each_pair do |_label, foot|
|
1315
1315
|
out_rows << nil
|
1316
|
-
foot_row = Hash.new([nil, ''])
|
1316
|
+
foot_row = Hash.new([nil, ''].freeze)
|
1317
1317
|
foot.to_h.each_pair do |h, v|
|
1318
1318
|
istruct = format_at[:gfooter][h]
|
1319
1319
|
foot_row[h] = [v, format_cell(v, istruct, decorate: decorate)]
|
@@ -49,6 +49,24 @@ module FatTable
|
|
49
49
|
result
|
50
50
|
end
|
51
51
|
|
52
|
+
# :stopdoc:
|
53
|
+
# Unicode line-drawing characters. We use double lines before and after the
|
54
|
+
# table and single lines for the sides and hlines between groups and
|
55
|
+
# footers.
|
56
|
+
UPPER_LEFT = "\u2552"
|
57
|
+
UPPER_RIGHT = "\u2555"
|
58
|
+
DOUBLE_RULE = "\u2550"
|
59
|
+
UPPER_TEE = "\u2564"
|
60
|
+
VERTICAL_RULE = "\u2502"
|
61
|
+
LEFT_TEE = "\u251C"
|
62
|
+
HORIZONTAL_RULE = "\u2500"
|
63
|
+
SINGLE_CROSS = "\u253C"
|
64
|
+
RIGHT_TEE = "\u2524"
|
65
|
+
LOWER_LEFT = "\u2558"
|
66
|
+
LOWER_RIGHT = "\u255B"
|
67
|
+
LOWER_TEE = "\u2567"
|
68
|
+
# :startdoc:
|
69
|
+
|
52
70
|
private
|
53
71
|
|
54
72
|
def color_valid?(clr)
|
@@ -99,24 +117,6 @@ module FatTable
|
|
99
117
|
colorize(str, @options[:frame_fg], @options[:frame_bg])
|
100
118
|
end
|
101
119
|
|
102
|
-
# :stopdoc:
|
103
|
-
# Unicode line-drawing characters. We use double lines before and after the
|
104
|
-
# table and single lines for the sides and hlines between groups and
|
105
|
-
# footers.
|
106
|
-
UPPER_LEFT = "\u2552"
|
107
|
-
UPPER_RIGHT = "\u2555"
|
108
|
-
DOUBLE_RULE = "\u2550"
|
109
|
-
UPPER_TEE = "\u2564"
|
110
|
-
VERTICAL_RULE = "\u2502"
|
111
|
-
LEFT_TEE = "\u251C"
|
112
|
-
HORIZONTAL_RULE = "\u2500"
|
113
|
-
SINGLE_CROSS = "\u253C"
|
114
|
-
RIGHT_TEE = "\u2524"
|
115
|
-
LOWER_LEFT = "\u2558"
|
116
|
-
LOWER_RIGHT = "\u255B"
|
117
|
-
LOWER_TEE = "\u2567"
|
118
|
-
# :startdoc:
|
119
|
-
|
120
120
|
def upper_left
|
121
121
|
if options[:unicode]
|
122
122
|
UPPER_LEFT
|
data/lib/fat_table/table.rb
CHANGED
@@ -135,7 +135,7 @@ module FatTable
|
|
135
135
|
# might have been set by a subclass instance.
|
136
136
|
def empty_dup(result_cols = nil)
|
137
137
|
result_cols ||= heads
|
138
|
-
result_types = types.
|
138
|
+
result_types = types.slice(*result_cols)
|
139
139
|
result = self.class.new(result_cols, **result_types)
|
140
140
|
tolerant_cols.each do |h|
|
141
141
|
result.tolerant_cols << h
|
@@ -1521,7 +1521,7 @@ module FatTable
|
|
1521
1521
|
groups = sorted_tab.rows.group_by do |r|
|
1522
1522
|
group_cols.map { |k| r[k] }
|
1523
1523
|
end
|
1524
|
-
grp_types = types.
|
1524
|
+
grp_types = types.slice(*group_cols)
|
1525
1525
|
result = Table.new(*group_cols, **grp_types)
|
1526
1526
|
groups.each_pair do |_vals, grp_rows|
|
1527
1527
|
result << row_from_group(grp_rows, group_cols, agg_cols)
|
data/lib/fat_table/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel E. Doherty
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: csv
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
rubygems_version: 3.6.
|
184
|
+
rubygems_version: 3.6.3
|
185
185
|
specification_version: 4
|
186
186
|
summary: Provides tools for working with tables as a data type.
|
187
187
|
test_files: []
|