fat_table 0.9.1 → 0.9.3

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: 0b13c85cc10ea33c6013969fb277fedfe2dabd7e195e7b71b0e43623d40d53e1
4
- data.tar.gz: 73b16003325654444f258233abeaa96bb5aa9401441e2993a0e5d80e4df4ead8
3
+ metadata.gz: c938654651af21d509d2a71fe8a7a9c36747f33e04d1be8eab4c020c1400a26e
4
+ data.tar.gz: 6d9191d19b79a70a963eb16eaabfaefb2643cd0df7b9dec7a77c5d36f2c836b0
5
5
  SHA512:
6
- metadata.gz: 27b7bd5a2ab7344e16b64e3b8e66455de579a1145a40a0551f3c28be5836b439485d66a6ea2ad230f44c8f64d6fabc0014e894526539deeced85703eb7d54334
7
- data.tar.gz: 9d6b8f4eb9c9f399963edcfd99a8b31a2b31cc9bae7a2748c72459052b54047c853600452f41934b0466cfc9e375e084da017a55153ac2cdf3571da95e410668
6
+ metadata.gz: 38371b27911a835c34e7536bc6226b08a20225d399b4feaa6e6bb6e1dbb6031292d10ea6673c4dabb77c2576294188ce6ab6d76186f6d0a8c803a175e2db3907
7
+ data.tar.gz: 69a13614617e0423cb7739ec47939841bb96eb5c460d0711528e2163969b70339a14a129a96ed5d68f8908a86479c4ee596799197423cf2cbf3d56f7afe5ba90
data/README.org CHANGED
@@ -2614,19 +2614,22 @@ parameter. See below at [[*Table Locations][Table Locations]] for an explanatio
2614
2614
  locations available.
2615
2615
 
2616
2616
  Other than that first parameter, the two methods take the same types of
2617
- parameters. The remaining parameters are hash-like parameters that use either a
2618
- column name or a type as the key and a string with the formatting directives to
2619
- apply as the value. The following example says to set the formatting for all
2620
- locations in the table and to format all numeric fields as strings that are
2621
- rounded to whole numbers (the '0.0' part), that are right-aligned (the 'R'
2622
- part), and have grouping commas inserted (the ',' part). But the ~:id~ column is
2623
- numeric, and the second parameter overrides the formatting for numerics in
2624
- general and calls for the ~:id~ column to be padded to three digits with zeros
2625
- on the left (the '3.0' part) and to be centered (the 'C' part).
2617
+ parameters. The remaining parameters are hash-like parameters that use either
2618
+ a column name or a type as the key and a string with the formatting directives
2619
+ to apply as the value. If a key represents neither a column name nor a valid
2620
+ type, it is silently ignored. The following example says to set the
2621
+ formatting for all locations in the table and to format all numeric fields as
2622
+ strings that are rounded to whole numbers (the '0.0' part), that are
2623
+ right-aligned (the 'R' part), and have grouping commas inserted (the ','
2624
+ part). But the ~:id~ column is numeric, and the second parameter overrides the
2625
+ formatting for numerics in general and calls for the ~:id~ column to be padded
2626
+ to three digits with zeros on the left (the '3.0' part) and to be centered
2627
+ (the 'C' part).
2626
2628
 
2627
2629
  #+BEGIN_SRC ruby :wrap EXAMPLE
2628
2630
  tab_a.to_text do |f|
2629
- f.format(numeric: '0.0,R', id: '3.0C')
2631
+ # Note: blat: is silently ignored
2632
+ f.format(numeric: '0.0,R', id: '3.0C', blat: 'B')
2630
2633
  f.format_for(:body, string: 'R')
2631
2634
  f.format_for(:header, string: 'C')
2632
2635
  end
@@ -648,12 +648,6 @@ module FatTable
648
648
  k
649
649
  end
650
650
  end
651
- valid_keys = table.headers + %i[string numeric datetime boolean nil]
652
- invalid_keys = (fmts.keys - valid_keys).uniq
653
- unless invalid_keys.empty?
654
- msg = "invalid #{location} column or type: #{invalid_keys.join(', ')}"
655
- raise UserError, msg
656
- end
657
651
 
658
652
  @format_at[location] ||= {}
659
653
  table.headers.each do |h|
@@ -137,7 +137,7 @@ module FatTable
137
137
  def empty_dup(result_cols = nil)
138
138
  result_cols ||= heads
139
139
  result_types = types.select { |k,_v| result_cols.include?(k) }
140
- result = Table.new(result_cols, **result_types)
140
+ result = self.class.new(result_cols, **result_types)
141
141
  tolerant_cols.each do |h|
142
142
  result.tolerant_cols << h
143
143
  result.column(h).tolerant = true
@@ -2,5 +2,5 @@
2
2
 
3
3
  module FatTable
4
4
  # The current version of FatTable
5
- VERSION = '0.9.1'
5
+ VERSION = '0.9.3'
6
6
  end
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.9.1
4
+ version: 0.9.3
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: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler