tabulo 2.7.1 → 2.7.2

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: 63054578d0f667075a8e2888d3fc0a2572ec9b8a93e3f74468f058613a7c2f19
4
- data.tar.gz: 3d0b8bad1b9ad7fa2949037ec6de683f7b43c7ecc73ca02c53bbb14f926139fe
3
+ metadata.gz: f2419c20288ae285e4fcbfefd5627f6dac370ab3940969093216283407df6ee4
4
+ data.tar.gz: '08ee67482f630a3f185319fcc7fec4844b3a64d70042f3afc9abb993e4a65260'
5
5
  SHA512:
6
- metadata.gz: d8626993288417bdd75b581819ea4ef9ef79bfcdfb5d18e7469ac2699e303096405f6155b690a289f5bbc27a8235cc80fb4cb0ad8e62146c664f198fefce9a7e
7
- data.tar.gz: 9a306fb542677778f3e6998ee83352f87802bf6d07b422846b61d1fe42acdd8b40a914daa87a10e5abe2f84e6d4b8cd5ddc5711e49d9b5d066113b167b4cf4a9
6
+ metadata.gz: 97f9cc96273afdc2fb30f341cc7dede4440cc2198209035bdbb65bf4872628a0db6a42f29287a7f9a2aa08c0fd2495bd7cdf189529ef1ce93f62797a5cfdb8dd
7
+ data.tar.gz: 96e4fd149487e51a49bb3935ec4341c0a327f101d028019b8bf73279b3e239cf3d8deb0fd5efda92c8d10d79c5bf1973b16344e45e753695b6920c6c4111f852
@@ -23,9 +23,9 @@ jobs:
23
23
  '2.3.8',
24
24
  '2.4.10',
25
25
  '2.5.9',
26
- '2.6.8',
27
- '2.7.4',
28
- '3.0.2',
26
+ '2.6.9',
27
+ '2.7.5',
28
+ '3.0.3',
29
29
  ]
30
30
  steps:
31
31
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ### v2.7.2
4
+
5
+ * Minor documentation improvements and tweaks
6
+ * Upgrade Ruby patch versions in CI config
7
+
3
8
  ### v2.7.1
4
9
 
5
10
  * Dependency version upgrades
data/README.md CHANGED
@@ -6,8 +6,7 @@
6
6
  [![Coverage Status][CS img]][Coverage Status]
7
7
  [![Awesome][AR img]][Awesome Ruby]
8
8
 
9
- Tabulo is a Ruby library for generating plain text tables (also known as “terminal tables”
10
- or “ASCII tables”). It is both highly configurable and very easy to use.
9
+ Tabulo is a Ruby library for generating plain text tables. It is both highly configurable and very easy to use.
11
10
 
12
11
  <a name="overview"></a>
13
12
  ## Overview
@@ -103,7 +102,7 @@ Tabulo has also been ported to Crystal (with some modifications): see [Tablo](ht
103
102
  * [Setting default styles](#default-styles)
104
103
  * [Styling borders](#styling-borders)
105
104
  * [Repeating headers](#repeating-headers)
106
- * [Using a Table Enumerator](#using-a-table-enumerator)
105
+ * [Using a Table Enumerator](#enumerator)
107
106
  * [Accessing cell values](#accessing-cell-values)
108
107
  * [Accessing the underlying enumerable](#accessing-sources)
109
108
  * [Transposing rows and columns](#transposition)
@@ -793,7 +792,7 @@ the table.
793
792
  The `formatter` callback also has an alternative, 2-parameter version. If `formatter` is passed
794
793
  a 2-parameter callable, the second parameter will be given a `CellData` instance,
795
794
  containing additional information about the cell that may be useful in determining how to format
796
- it&mdash;see the [documentation](https://www.rubydoc.info/gems/tabulo/2.7.1/Tabulo/CellData.html)
795
+ it&mdash;see the [documentation](https://www.rubydoc.info/gems/tabulo/2.7.2/Tabulo/CellData.html)
797
796
  for details.
798
797
 
799
798
  <a name="colours-and-styling"></a>
@@ -839,7 +838,7 @@ number is even). The second parameter represents the formatted string value of t
839
838
  content after any processing by the [formatter](#formatting-cell-values). The third and fourth
840
839
  parameters are optional, and contain further information about the cell and its contents that may be useful in
841
840
  determining how to style it. See the
842
- [documentation](https://www.rubydoc.info/gems/tabulo/2.7.1/Tabulo/Table#add_column-instance_method) for details.
841
+ [documentation](https://www.rubydoc.info/gems/tabulo/2.7.2/Tabulo/Table#add_column-instance_method) for details.
843
842
 
844
843
  If the content of a cell is wrapped over multiple lines, then the `styler` will be called once
845
844
  per line, so that each line of the cell will have the escape sequence applied to it separately
@@ -859,7 +858,7 @@ table.add_column(:even?, header_styler: -> (s) { "\033[32m#{s}\033[0m" })
859
858
  ```
860
859
 
861
860
  The `header_styler` option accepts a 1-, 2- or 3-parameter callable. See the
862
- [documentation](https://www.rubydoc.info/gems/tabulo/2.7.1/Tabulo/Table#add_column-instance_method)
861
+ [documentation](https://www.rubydoc.info/gems/tabulo/2.7.2/Tabulo/Table#add_column-instance_method)
863
862
  for details.
864
863
 
865
864
  <a name="styling-title"></a>
@@ -873,7 +872,7 @@ table = Tabulo::Table.new(1..5, :itself, :even?, :odd?, title: "Numbers", title_
873
872
  ```
874
873
 
875
874
  The `title_styler` option accepts a 1- or 2-parameter callable. See the
876
- [documentation](https://www.rubydoc.info/gems/tabulo/2.7.1/Tabulo/Table#initialize-instance_method)
875
+ [documentation](https://www.rubydoc.info/gems/tabulo/2.7.2/Tabulo/Table#initialize-instance_method)
877
876
  for details.
878
877
 
879
878
  <a name="styling-borders"></a>
@@ -939,6 +938,12 @@ table = Tabulo::Table.new(1..10, :itself, :even?, header_frequency: 5)
939
938
 
940
939
  Note that if the table has a [title](#title), it will not be repeated; only column headers are repeated.
941
940
 
941
+ One can achieve even finer-grained control over printing of headers within the table body by stepping
942
+ through the table a row at a time (using `.each` or other methods of `Enumerable`) and calling the
943
+ the [`formatted_header`](https://www.rubydoc.info/gems/tabulo/Tabulo/Table#formatted_header-instance_method)
944
+ method in combination with [`horizontal_rule`](https://www.rubydoc.info/gems/tabulo/Tabulo%2FTable:horizontal_rule)
945
+ to produce headers at arbitrary points in the output.
946
+
942
947
  <a name="enumerator"></a>
943
948
  ### Using a Table Enumerator [&#x2191;](#contents)
944
949
 
@@ -1068,7 +1073,7 @@ a new table in which the rows and columns are swapped:
1068
1073
  By default, a header row is added to the new table, showing the string value of the element
1069
1074
  represented in that column. This can be configured, however, along with other aspects of
1070
1075
  `transpose`&#8217;s behaviour. For details, see the
1071
- [documentation](https://www.rubydoc.info/gems/tabulo/2.7.1/Tabulo/Table#transpose-instance_method).
1076
+ [documentation](https://www.rubydoc.info/gems/tabulo/2.7.2/Tabulo/Table#transpose-instance_method).
1072
1077
 
1073
1078
  <a name="borders"></a>
1074
1079
  ### Configuring borders [&#x2191;](#contents)
@@ -1286,6 +1291,11 @@ If you want a line before every row, pass `1` to `row_divider_frequency`. For ex
1286
1291
  +--------------+--------------+--------------+
1287
1292
  ```
1288
1293
 
1294
+ In addition to these options, it is also possible to print horizontal dividers at any chosen
1295
+ point in the table output, by stepping through the table one row at a time
1296
+ and calling the [`horizontal_rule`](https://www.rubydoc.info/gems/tabulo/Tabulo%2FTable:horizontal_rule)
1297
+ method as required.
1298
+
1289
1299
  <a name="freezing-a-table"></a>
1290
1300
  ### Using a table as a snapshot rather than as a dynamic view [&#x2191;](#contents)
1291
1301
 
@@ -1459,13 +1469,13 @@ The gem is available as open source under the terms of the [MIT
1459
1469
  License](http://opensource.org/licenses/MIT).
1460
1470
 
1461
1471
  [Gem Version]: https://rubygems.org/gems/tabulo
1462
- [Documentation]: http://www.rubydoc.info/gems/tabulo/2.7.1
1472
+ [Documentation]: http://www.rubydoc.info/gems/tabulo
1463
1473
  [Build Status]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml
1464
1474
  [Coverage Status]: https://coveralls.io/github/matt-harvey/tabulo
1465
1475
  [Awesome Ruby]: https://github.com/markets/awesome-ruby#cli-utilities
1466
1476
 
1467
1477
  [GV img]: https://img.shields.io/gem/v/tabulo.svg
1468
- [DC img]: https://img.shields.io/badge/documentation-v2.7.1-blue.svg
1478
+ [DC img]: https://img.shields.io/badge/documentation-v2.7.2-blue.svg
1469
1479
  [BS img]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml/badge.svg
1470
1480
  [CS img]: https://img.shields.io/coveralls/matt-harvey/tabulo.svg
1471
1481
  [AR img]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.7.1
1
+ 2.7.2
data/lib/tabulo/table.rb CHANGED
@@ -420,7 +420,7 @@ module Tabulo
420
420
  end
421
421
 
422
422
  # @return [String] a graphical representation of the Table column headers formatted with fixed
423
- # width plain text.
423
+ # width plain text, excluding any horizontal borders above or below.
424
424
  def formatted_header
425
425
  cells = get_columns.map(&:header_cell)
426
426
  format_row(cells, @wrap_header_cells_to)
@@ -1,3 +1,3 @@
1
1
  module Tabulo
2
- VERSION = "2.7.1"
2
+ VERSION = "2.7.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabulo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Harvey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-08 00:00:00.000000000 Z
11
+ date: 2021-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-screen
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubygems_version: 3.2.29
224
+ rubygems_version: 3.2.3
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Terminal table generator