tabulo 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/README.md +36 -34
- data/VERSION +1 -1
- data/lib/tabulo/version.rb +1 -1
- data/tabulo.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bf2b89914117264e5f213553c792d1456d4f5d99ae8afac565ff1dbc069400b
|
4
|
+
data.tar.gz: 6220df7007ae352c400291101f6308f99ad063fe98c5820820da599f674d4a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13228bb55890713cb9483f18d55339dcf7393aff65a7f91383eb9a5d7dce03acd968e09e883ae3f72088e4d543d1bdc962cb38a0c9444cdd1a93482c55f9c354
|
7
|
+
data.tar.gz: e865337603240b4b8456f5b2b7bbb64f660b18acfc4caf0318ef9869f58070801da24bbdd7de740133a6ef386d5c6c02ee198098605fb7a13acd60547bbdb04e
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -492,14 +492,14 @@ table = Tabulo::Table.new([1, 2, 5], :itself, :even?, :odd?, column_padding: 0)
|
|
492
492
|
```
|
493
493
|
|
494
494
|
```
|
495
|
-
> puts table
|
496
|
-
|
497
|
-
|
|
498
|
-
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
495
|
+
> puts table.pack
|
496
|
+
+------+-----+-----+
|
497
|
+
|itself|even?| odd?|
|
498
|
+
+------+-----+-----+
|
499
|
+
| 1|false| true|
|
500
|
+
| 2| true|false|
|
501
|
+
| 5|false| true|
|
502
|
+
+------+-----+-----+
|
503
503
|
```
|
504
504
|
|
505
505
|
Passing an array of _two_ integers to this option configures the left and right padding for each
|
@@ -510,33 +510,35 @@ table = Tabulo::Table.new([1, 2, 5], :itself, :even?, :odd?, column_padding: [0,
|
|
510
510
|
```
|
511
511
|
|
512
512
|
```
|
513
|
-
> puts table
|
514
|
-
|
515
|
-
|
|
516
|
-
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
513
|
+
> puts table.pack
|
514
|
+
+--------+-------+-------+
|
515
|
+
|itself |even? | odd? |
|
516
|
+
+--------+-------+-------+
|
517
|
+
| 1 |false | true |
|
518
|
+
| 2 | true |false |
|
519
|
+
| 5 |false | true |
|
520
|
+
+--------+-------+-------+
|
521
521
|
```
|
522
522
|
|
523
|
+
Note how the padding amount is completely unaffected by the call `pack`.
|
524
|
+
|
523
525
|
Padding can also be configured on a column-by-column basis, using the `padding` option when calling
|
524
526
|
`add_column`:
|
525
527
|
|
526
528
|
```ruby
|
527
529
|
table = Tabulo::Table.new([1, 2, 5], :itself, :even?)
|
528
|
-
table.add_column(:odd?, padding:
|
530
|
+
table.add_column(:odd?, padding: 3)
|
529
531
|
```
|
530
532
|
|
531
533
|
```
|
532
|
-
> puts table
|
533
|
-
|
534
|
-
|
|
535
|
-
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
534
|
+
> puts table.pack
|
535
|
+
+--------+-------+-----------+
|
536
|
+
| itself | even? | odd? |
|
537
|
+
+--------+-------+-----------+
|
538
|
+
| 1 | false | true |
|
539
|
+
| 2 | true | false |
|
540
|
+
| 5 | false | true |
|
541
|
+
+--------+-------+-----------+
|
540
542
|
```
|
541
543
|
|
542
544
|
This column-level `padding` setting always overrides any table-level `column_padding` setting, for
|
@@ -681,7 +683,7 @@ the table.
|
|
681
683
|
The `formatter` callback also has an alternative, 2-parameter version. If `formatter` is passed
|
682
684
|
a 2-parameter callable, the second parameter will be given a `CellData` instance,
|
683
685
|
containing additional information about the cell that may be useful in determining how to format
|
684
|
-
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/2.6.
|
686
|
+
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/2.6.1/Tabulo/CellData.html)
|
685
687
|
for details.
|
686
688
|
|
687
689
|
<a name="colours-and-styling"></a>
|
@@ -721,13 +723,13 @@ table.add_column(
|
|
721
723
|
)
|
722
724
|
```
|
723
725
|
|
724
|
-
The `styler` option should be passed a callable that takes either
|
726
|
+
The `styler` option should be passed a callable that takes either 2, 3 or 4 parameters.
|
725
727
|
The first parameter represents the underlying value of the cell (in this case a boolean indicating whether the
|
726
728
|
number is even). The second parameter represents the formatted string value of that cell, i.e. the cell
|
727
729
|
content after any processing by the [formatter](#formatting-cell-values). The third and fourth
|
728
730
|
parameters are optional, and contain further information about the cell and its contents that may be useful in
|
729
|
-
determining how to style it. See the
|
730
|
-
for details.
|
731
|
+
determining how to style it. See the
|
732
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.1/Tabulo/Table#add_column-instance_method) for details.
|
731
733
|
|
732
734
|
If the content of a cell is wrapped over multiple lines, then the `styler` will be called once
|
733
735
|
per line, so that each line of the cell will have the escape sequence applied to it separately
|
@@ -747,7 +749,7 @@ table.add_column(:even?, header_styler: -> (s) { "\033[32m#{s}\033[0m" })
|
|
747
749
|
```
|
748
750
|
|
749
751
|
The `header_styler` option accepts a 1-, 2- or 3-parameter callable. See the
|
750
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.
|
752
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.1/Tabulo/Table#add_column-instance_method)
|
751
753
|
for details.
|
752
754
|
|
753
755
|
<a name="styling-title"></a>
|
@@ -761,7 +763,7 @@ table = Tabulo::Table.new(1..5, :itself, :even?, :odd?, title: "Numbers", title_
|
|
761
763
|
```
|
762
764
|
|
763
765
|
The `title_styler` option accepts a 1- or 2-parameter callable. See the
|
764
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.
|
766
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.1/Tabulo/Table#initialize-instance_method)
|
765
767
|
for details.
|
766
768
|
|
767
769
|
<a name="styling-borders"></a>
|
@@ -956,7 +958,7 @@ a new table in which the rows and columns are swapped:
|
|
956
958
|
By default, a header row is added to the new table, showing the string value of the element
|
957
959
|
represented in that column. This can be configured, however, along with other aspects of
|
958
960
|
`transpose`’s behaviour. For details, see the
|
959
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.
|
961
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.6.1/Tabulo/Table#transpose-instance_method).
|
960
962
|
|
961
963
|
<a name="borders"></a>
|
962
964
|
### Configuring borders [↑](#contents)
|
@@ -1339,14 +1341,14 @@ The gem is available as open source under the terms of the [MIT
|
|
1339
1341
|
License](http://opensource.org/licenses/MIT).
|
1340
1342
|
|
1341
1343
|
[Gem Version]: https://rubygems.org/gems/tabulo
|
1342
|
-
[Documentation]: http://www.rubydoc.info/gems/tabulo/2.6.
|
1344
|
+
[Documentation]: http://www.rubydoc.info/gems/tabulo/2.6.1
|
1343
1345
|
[Build Status]: https://travis-ci.org/matt-harvey/tabulo
|
1344
1346
|
[Coverage Status]: https://coveralls.io/r/matt-harvey/tabulo
|
1345
1347
|
[Code Climate]: https://codeclimate.com/github/matt-harvey/tabulo
|
1346
1348
|
[Awesome Ruby]: https://github.com/markets/awesome-ruby#cli-utilities
|
1347
1349
|
|
1348
1350
|
[GV img]: https://img.shields.io/gem/v/tabulo.svg
|
1349
|
-
[DC img]: https://img.shields.io/badge/documentation-v2.6.
|
1351
|
+
[DC img]: https://img.shields.io/badge/documentation-v2.6.1-blue.svg
|
1350
1352
|
[BS img]: https://img.shields.io/travis/matt-harvey/tabulo.svg
|
1351
1353
|
[CS img]: https://img.shields.io/coveralls/matt-harvey/tabulo.svg
|
1352
1354
|
[CC img]: https://codeclimate.com/github/matt-harvey/tabulo/badges/gpa.svg
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6.
|
1
|
+
2.6.1
|
data/lib/tabulo/version.rb
CHANGED
data/tabulo.gemspec
CHANGED
@@ -28,12 +28,12 @@ Gem::Specification.new do |spec|
|
|
28
28
|
"changelog_uri" => "https://raw.githubusercontent.com/matt-harvey/tabulo/master/CHANGELOG.md"
|
29
29
|
}
|
30
30
|
|
31
|
-
spec.add_runtime_dependency "tty-screen", "0.
|
31
|
+
spec.add_runtime_dependency "tty-screen", "0.8.1"
|
32
32
|
spec.add_runtime_dependency "unicode-display_width", "1.7.0"
|
33
33
|
|
34
34
|
spec.add_development_dependency "bundler"
|
35
35
|
spec.add_development_dependency "rake", "~> 12.3.3"
|
36
|
-
spec.add_development_dependency "rspec", "~> 3.
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.9"
|
37
37
|
spec.add_development_dependency "simplecov"
|
38
38
|
spec.add_development_dependency "coveralls"
|
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.6.
|
4
|
+
version: 2.6.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: 2020-
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.8.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: unicode-display_width
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.9'
|
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.9'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|