tabulo 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +4 -4
- data/README.md +12 -9
- data/VERSION +1 -1
- data/lib/tabulo/version.rb +1 -1
- data/tabulo.gemspec +3 -3
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0967716cb8ae0364c51187023e9515933615d25de080d95b08c931cbf17a11a0'
|
4
|
+
data.tar.gz: e6497d0121eefcb8960370a5ee9d3884143b89a0a45336aaa30814095be3794d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d49aeccc15b496344ae03b93ca10cce1b3c02d706f43e68f30285f7c0bf9c6a81bbcbec68768791b5cb37b0f75dcec33ce45999e87b33ee39a01eb8997217ca
|
7
|
+
data.tar.gz: 846cfe4796836b485848b6f9fdcd1b1e8f0907587b5c32debb50734ded99e6992e56a4b62d6d755740e03d5831182fb4e7f0c9fe67e04bad636baac2cc090deb
|
data/.github/workflows/tests.yml
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,8 @@
|
|
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
|
9
|
+
Tabulo is a Ruby library for generating plain text tables, also known as “ASCII tables”. It is
|
10
|
+
both highly configurable and very easy to use.
|
10
11
|
|
11
12
|
<a name="overview"></a>
|
12
13
|
## Overview
|
@@ -137,6 +138,8 @@ require 'tabulo'
|
|
137
138
|
```
|
138
139
|
|
139
140
|
<a name="detailed-usage"></a>
|
141
|
+
## Detailed usage [↑](#contents)
|
142
|
+
|
140
143
|
<a name="table-initialization"></a>
|
141
144
|
### Creating a table [↑](#contents)
|
142
145
|
|
@@ -541,8 +544,8 @@ linebreaks in your data. When using this option, other columns might be shrunk m
|
|
541
544
|
the table fit within the `max_table_width`.
|
542
545
|
|
543
546
|
For even finer-grained control over column and table resizing, see the
|
544
|
-
for the [`#autosize_columns`](https://www.rubydoc.info/gems/tabulo/2.8.
|
545
|
-
and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/2.8.
|
547
|
+
for the [`#autosize_columns`](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#autosize_columns-instance_method)
|
548
|
+
and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#shrink_to-instance_method) methods.
|
546
549
|
|
547
550
|
Note that `pack`ing the table necessarily involves traversing the entire collection up front as
|
548
551
|
the maximum cell width needs to be calculated for each column. You may not want to do this
|
@@ -807,7 +810,7 @@ the table.
|
|
807
810
|
The `formatter` callback also has an alternative, 2-parameter version. If `formatter` is passed
|
808
811
|
a 2-parameter callable, the second parameter will be given a `CellData` instance,
|
809
812
|
containing additional information about the cell that may be useful in determining how to format
|
810
|
-
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/2.8.
|
813
|
+
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/CellData.html)
|
811
814
|
for details.
|
812
815
|
|
813
816
|
<a name="colours-and-styling"></a>
|
@@ -853,7 +856,7 @@ number is even). The second parameter represents the formatted string value of t
|
|
853
856
|
content after any processing by the [formatter](#formatting-cell-values). The third and fourth
|
854
857
|
parameters are optional, and contain further information about the cell and its contents that may be useful in
|
855
858
|
determining how to style it. See the
|
856
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.
|
859
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#add_column-instance_method) for details.
|
857
860
|
|
858
861
|
If the content of a cell is wrapped over multiple lines, then the `styler` will be called once
|
859
862
|
per line, so that each line of the cell will have the escape sequence applied to it separately
|
@@ -873,7 +876,7 @@ table.add_column(:even?, header_styler: -> (s) { "\033[32m#{s}\033[0m" })
|
|
873
876
|
```
|
874
877
|
|
875
878
|
The `header_styler` option accepts a 1-, 2- or 3-parameter callable. See the
|
876
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.
|
879
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#add_column-instance_method)
|
877
880
|
for details.
|
878
881
|
|
879
882
|
<a name="styling-title"></a>
|
@@ -887,7 +890,7 @@ table = Tabulo::Table.new(1..5, :itself, :even?, :odd?, title: "Numbers", title_
|
|
887
890
|
```
|
888
891
|
|
889
892
|
The `title_styler` option accepts a 1- or 2-parameter callable. See the
|
890
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.
|
893
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#initialize-instance_method)
|
891
894
|
for details.
|
892
895
|
|
893
896
|
<a name="styling-borders"></a>
|
@@ -1088,7 +1091,7 @@ a new table in which the rows and columns are swapped:
|
|
1088
1091
|
By default, a header row is added to the new table, showing the string value of the element
|
1089
1092
|
represented in that column. This can be configured, however, along with other aspects of
|
1090
1093
|
`transpose`’s behaviour. For details, see the
|
1091
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.
|
1094
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#transpose-instance_method).
|
1092
1095
|
|
1093
1096
|
<a name="borders"></a>
|
1094
1097
|
### Configuring borders [↑](#contents)
|
@@ -1491,7 +1494,7 @@ License](http://opensource.org/licenses/MIT).
|
|
1491
1494
|
[Awesome Ruby]: https://github.com/markets/awesome-ruby#cli-utilities
|
1492
1495
|
|
1493
1496
|
[GV img]: https://img.shields.io/gem/v/tabulo.svg
|
1494
|
-
[DC img]: https://img.shields.io/badge/documentation-v2.8.
|
1497
|
+
[DC img]: https://img.shields.io/badge/documentation-v2.8.1-blue.svg
|
1495
1498
|
[BS img]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml/badge.svg
|
1496
1499
|
[CS img]: https://img.shields.io/coveralls/matt-harvey/tabulo.svg
|
1497
1500
|
[AR img]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.8.
|
1
|
+
2.8.1
|
data/lib/tabulo/version.rb
CHANGED
data/tabulo.gemspec
CHANGED
@@ -29,11 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
}
|
30
30
|
|
31
31
|
spec.add_runtime_dependency "tty-screen", "0.8.1"
|
32
|
-
spec.add_runtime_dependency "unicode-display_width", "2.
|
32
|
+
spec.add_runtime_dependency "unicode-display_width", "2.2.0"
|
33
33
|
|
34
34
|
spec.add_development_dependency "bundler"
|
35
|
-
spec.add_development_dependency "rake", "~>
|
36
|
-
spec.add_development_dependency "rspec", "~> 3.
|
35
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.11"
|
37
37
|
spec.add_development_dependency "simplecov"
|
38
38
|
spec.add_development_dependency "simplecov-lcov"
|
39
39
|
spec.add_development_dependency "yard"
|
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.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Harvey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '13.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '13.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.11'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '3.
|
82
|
+
version: '3.11'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|