tabulo 2.6.0 → 2.7.0
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 +58 -0
- data/.simplecov +0 -0
- data/CHANGELOG.md +19 -0
- data/README.md +119 -63
- data/VERSION +1 -1
- data/lib/tabulo/cell.rb +76 -16
- data/lib/tabulo/column.rb +4 -0
- data/lib/tabulo/table.rb +47 -29
- data/lib/tabulo/util.rb +3 -1
- data/lib/tabulo/version.rb +1 -1
- data/tabulo.gemspec +4 -4
- metadata +14 -13
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 632d2d2d3b7d0120410d0afd2b8f1d1b341fd1b6daa7802b15b6f791640d409e
|
4
|
+
data.tar.gz: f5720b528f1c4384118196619ea923b317ec3ff7d374fa87d79808361031e7cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283e3ac39971cfdf9df9968fe0e40b00d049865fe7f49ef0403d71e35ea8f49a43d85579cb9f12d080e0bacafa48c943d2e57176309be99809272983cd9db2d7
|
7
|
+
data.tar.gz: 32256e95de32d81a65d64e49a6f1eb42c33d7ccca2c76a5d6ce5cb6d0beee8c9d5588aa6d5df2c68a59ac8805e5b5048851a0959ddf281eaf891771ee162158c
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Tests
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [master]
|
13
|
+
pull_request:
|
14
|
+
branches: [master]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
strategy:
|
20
|
+
matrix:
|
21
|
+
ruby-version: [
|
22
|
+
'2.2.10',
|
23
|
+
'2.3.8',
|
24
|
+
'2.4.10',
|
25
|
+
'2.5.9',
|
26
|
+
'2.6.7',
|
27
|
+
'2.7.3',
|
28
|
+
'3.0.1',
|
29
|
+
]
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v2
|
32
|
+
- name: Set up Ruby
|
33
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
34
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
35
|
+
uses: ruby/setup-ruby@v1 # Was: uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby-version }}
|
38
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
39
|
+
- name: Run tests
|
40
|
+
run: bundle exec rspec
|
41
|
+
|
42
|
+
- name: Report to Coveralls
|
43
|
+
uses: coverallsapp/github-action@v1.1.2
|
44
|
+
with:
|
45
|
+
github-token: ${{ secrets.github_token }}
|
46
|
+
flag-name: test-${{ matrix.ruby }}-${{ matrix.gemfile }}
|
47
|
+
parallel: true
|
48
|
+
|
49
|
+
finish:
|
50
|
+
needs: test
|
51
|
+
runs-on: ubuntu-latest
|
52
|
+
steps:
|
53
|
+
|
54
|
+
- name: Report completion to Coveralls
|
55
|
+
uses: coverallsapp/github-action@v1.1.2
|
56
|
+
with:
|
57
|
+
github-token: ${{ secrets.github_token }}
|
58
|
+
parallel-finished: true
|
data/.simplecov
ADDED
File without changes
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v2.7.0
|
4
|
+
|
5
|
+
* Add `wrap_preserve` option, allowing whole words to be preserved when wrapping.
|
6
|
+
* Internal: Use GitHub actions instead of Travis
|
7
|
+
|
8
|
+
### v2.6.3
|
9
|
+
|
10
|
+
* Update dependency versions
|
11
|
+
|
12
|
+
### v2.6.2
|
13
|
+
|
14
|
+
* Ensure line break character sequences are property formatted in output, regardless
|
15
|
+
of whether they are "\r\n", "\r" or "\n".
|
16
|
+
|
17
|
+
### v2.6.1
|
18
|
+
|
19
|
+
* Update dependency versions
|
20
|
+
* Minor documentation improvements
|
21
|
+
|
3
22
|
### v2.6.0
|
4
23
|
|
5
24
|
* Add an additional, optional parameter to `styler`, `header_styler` and `title_styler`
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
[![Gem Version][GV img]][Gem Version]
|
4
4
|
[![Documentation][DC img]][Documentation]
|
5
|
-
[![Coverage Status][CS img]][Coverage Status]
|
6
5
|
[![Build Status][BS img]][Build Status]
|
6
|
+
[![Coverage Status][CS img]][Coverage Status]
|
7
7
|
[![Code Climate][CC img]][Code Climate]
|
8
8
|
[![Awesome][AR img]][Awesome Ruby]
|
9
9
|
|
@@ -16,19 +16,19 @@ or “ASCII tables”). It is both highly configurable and very easy to
|
|
16
16
|
_Quick API:_
|
17
17
|
|
18
18
|
```
|
19
|
-
> puts Tabulo::Table.new(User.all, :id, :first_name, :last_name
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
> puts Tabulo::Table.new(User.all, :id, :first_name, :last_name).pack
|
20
|
+
+----+------------+-----------+
|
21
|
+
| id | first_name | last_name |
|
22
|
+
+----+------------+-----------+
|
23
|
+
| 1 | John | Citizen |
|
24
|
+
| 2 | Jane | Doe |
|
25
|
+
+----+------------+-----------+
|
26
26
|
```
|
27
27
|
|
28
28
|
_Full API:_
|
29
29
|
|
30
30
|
```
|
31
|
-
table = Tabulo::Table.new(User.all
|
31
|
+
table = Tabulo::Table.new(User.all) do |t|
|
32
32
|
t.add_column("ID", &:id)
|
33
33
|
t.add_column("First name", &:first_name)
|
34
34
|
t.add_column("Last name") { |user| user.last_name.upcase }
|
@@ -37,12 +37,12 @@ end
|
|
37
37
|
|
38
38
|
```
|
39
39
|
> puts table.pack
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
+----+------------+-----------+
|
41
|
+
| ID | First name | Last name |
|
42
|
+
+----+------------+-----------+
|
43
|
+
| 1 | John | CITIZEN |
|
44
|
+
| 2 | Jane | DOE |
|
45
|
+
+----+------------+-----------+
|
46
46
|
```
|
47
47
|
|
48
48
|
<a name="features"></a>
|
@@ -63,6 +63,7 @@ end
|
|
63
63
|
* The header row can be [repeated](#repeating-headers) at arbitrary intervals
|
64
64
|
* Newlines within cell content are correctly handled
|
65
65
|
* Multibyte Unicode characters are correctly handled
|
66
|
+
* Option to [preserve whole words](#preserve-words) when wrapping content
|
66
67
|
* Apply [colours](#colours-and-styling) and other styling to table content and borders, without breaking the table
|
67
68
|
* Easily [transpose](#transposition) the table, so that rows are swapped with columns
|
68
69
|
* Choose from multiple [border configurations](#borders), including Markdown, “ASCII”, and smoothly
|
@@ -492,14 +493,14 @@ table = Tabulo::Table.new([1, 2, 5], :itself, :even?, :odd?, column_padding: 0)
|
|
492
493
|
```
|
493
494
|
|
494
495
|
```
|
495
|
-
> puts table
|
496
|
-
|
497
|
-
|
|
498
|
-
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
496
|
+
> puts table.pack
|
497
|
+
+------+-----+-----+
|
498
|
+
|itself|even?| odd?|
|
499
|
+
+------+-----+-----+
|
500
|
+
| 1|false| true|
|
501
|
+
| 2| true|false|
|
502
|
+
| 5|false| true|
|
503
|
+
+------+-----+-----+
|
503
504
|
```
|
504
505
|
|
505
506
|
Passing an array of _two_ integers to this option configures the left and right padding for each
|
@@ -510,33 +511,35 @@ table = Tabulo::Table.new([1, 2, 5], :itself, :even?, :odd?, column_padding: [0,
|
|
510
511
|
```
|
511
512
|
|
512
513
|
```
|
513
|
-
> puts table
|
514
|
-
|
515
|
-
|
|
516
|
-
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
514
|
+
> puts table.pack
|
515
|
+
+--------+-------+-------+
|
516
|
+
|itself |even? | odd? |
|
517
|
+
+--------+-------+-------+
|
518
|
+
| 1 |false | true |
|
519
|
+
| 2 | true |false |
|
520
|
+
| 5 |false | true |
|
521
|
+
+--------+-------+-------+
|
521
522
|
```
|
522
523
|
|
524
|
+
Note how the padding amount is completely unaffected by the call `pack`.
|
525
|
+
|
523
526
|
Padding can also be configured on a column-by-column basis, using the `padding` option when calling
|
524
527
|
`add_column`:
|
525
528
|
|
526
529
|
```ruby
|
527
530
|
table = Tabulo::Table.new([1, 2, 5], :itself, :even?)
|
528
|
-
table.add_column(:odd?, padding:
|
531
|
+
table.add_column(:odd?, padding: 3)
|
529
532
|
```
|
530
533
|
|
531
534
|
```
|
532
|
-
> puts table
|
533
|
-
|
534
|
-
|
|
535
|
-
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
535
|
+
> puts table.pack
|
536
|
+
+--------+-------+-----------+
|
537
|
+
| itself | even? | odd? |
|
538
|
+
+--------+-------+-----------+
|
539
|
+
| 1 | false | true |
|
540
|
+
| 2 | true | false |
|
541
|
+
| 5 | false | true |
|
542
|
+
+--------+-------+-----------+
|
540
543
|
```
|
541
544
|
|
542
545
|
This column-level `padding` setting always overrides any table-level `column_padding` setting, for
|
@@ -594,11 +597,51 @@ table = Tabulo::Table.new(
|
|
594
597
|
The character used to indicate truncation, which defaults to `~`, can be configured using the
|
595
598
|
`truncation_indicator` option passed to `Table.new`.
|
596
599
|
|
600
|
+
<a name="preserve-words"></a>
|
601
|
+
#### Wrapping at word boundaries [↑](#contents)
|
602
|
+
|
603
|
+
By passing `:word` to the `wrap_preserve` option on either table initialization (for all columns),
|
604
|
+
or when calling `add_column` (for an individual column), whole words can be preserved when wrapping:
|
605
|
+
|
606
|
+
```ruby
|
607
|
+
sentences = [
|
608
|
+
"Words are preserved.",
|
609
|
+
"Excessively long words may still be split to fit into the configured column width.",
|
610
|
+
]
|
611
|
+
table = Tabulo::Table.new(sentences, :itself, :length, column_width: 10, wrap_preserve: :word)
|
612
|
+
```
|
613
|
+
|
614
|
+
```
|
615
|
+
> puts table
|
616
|
+
+------------+------------+
|
617
|
+
| itself | length |
|
618
|
+
+------------+------------+
|
619
|
+
| Words are | 20 |
|
620
|
+
| preserved. | |
|
621
|
+
| Excessivel | 82 |
|
622
|
+
| y long | |
|
623
|
+
| words may | |
|
624
|
+
| still be | |
|
625
|
+
| split to | |
|
626
|
+
| fit into | |
|
627
|
+
| the | |
|
628
|
+
| configured | |
|
629
|
+
| column | |
|
630
|
+
| width. | |
|
631
|
+
+------------+------------+
|
632
|
+
```
|
633
|
+
|
634
|
+
When wrapping cell content, Tabulo will never insert hyphens itself, although it will recognize existing
|
635
|
+
hyphens, m-dashes and n-dashes as word boundaries.
|
636
|
+
|
637
|
+
The `wrap_preserve` option defaults to the value `:rune`, meaning by default it will _not_ respect word
|
638
|
+
boundaries when wrapping (although it will always preserve whole multibyte Unicode characters).
|
639
|
+
|
597
640
|
<a name="manual-wrapping"></a>
|
598
641
|
#### Manual cell wrapping [↑](#contents)
|
599
642
|
|
600
643
|
You can “manually” wrap the content of a title, header or body cell at a particular
|
601
|
-
point, simply by placing a newline character at that point:
|
644
|
+
point, simply by placing a newline character, at that point:
|
602
645
|
|
603
646
|
```ruby
|
604
647
|
table = Tabulo::Table.new(1..3) do |t|
|
@@ -620,6 +663,11 @@ end
|
|
620
663
|
+--------------+--------------+--------------+
|
621
664
|
```
|
622
665
|
|
666
|
+
Tabulo will treat any of the character combinations `"\n"`, `"\r\n"` or `"\r"` equally, as a line break,
|
667
|
+
regardless of the platform it’s currently being run on. This ensures things are formatted as
|
668
|
+
expected if, for example, you are examining content that was produced on another platform from
|
669
|
+
the one you’re running Tabulo on.
|
670
|
+
|
623
671
|
<a name="formatting-cell-values"></a>
|
624
672
|
### Formatting cell values [↑](#contents)
|
625
673
|
|
@@ -681,7 +729,7 @@ the table.
|
|
681
729
|
The `formatter` callback also has an alternative, 2-parameter version. If `formatter` is passed
|
682
730
|
a 2-parameter callable, the second parameter will be given a `CellData` instance,
|
683
731
|
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.
|
732
|
+
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/2.7.0/Tabulo/CellData.html)
|
685
733
|
for details.
|
686
734
|
|
687
735
|
<a name="colours-and-styling"></a>
|
@@ -721,13 +769,13 @@ table.add_column(
|
|
721
769
|
)
|
722
770
|
```
|
723
771
|
|
724
|
-
The `styler` option should be passed a callable that takes either
|
772
|
+
The `styler` option should be passed a callable that takes either 2, 3 or 4 parameters.
|
725
773
|
The first parameter represents the underlying value of the cell (in this case a boolean indicating whether the
|
726
774
|
number is even). The second parameter represents the formatted string value of that cell, i.e. the cell
|
727
775
|
content after any processing by the [formatter](#formatting-cell-values). The third and fourth
|
728
776
|
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.
|
777
|
+
determining how to style it. See the
|
778
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.7.0/Tabulo/Table#add_column-instance_method) for details.
|
731
779
|
|
732
780
|
If the content of a cell is wrapped over multiple lines, then the `styler` will be called once
|
733
781
|
per line, so that each line of the cell will have the escape sequence applied to it separately
|
@@ -747,7 +795,7 @@ table.add_column(:even?, header_styler: -> (s) { "\033[32m#{s}\033[0m" })
|
|
747
795
|
```
|
748
796
|
|
749
797
|
The `header_styler` option accepts a 1-, 2- or 3-parameter callable. See the
|
750
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.
|
798
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.7.0/Tabulo/Table#add_column-instance_method)
|
751
799
|
for details.
|
752
800
|
|
753
801
|
<a name="styling-title"></a>
|
@@ -761,7 +809,7 @@ table = Tabulo::Table.new(1..5, :itself, :even?, :odd?, title: "Numbers", title_
|
|
761
809
|
```
|
762
810
|
|
763
811
|
The `title_styler` option accepts a 1- or 2-parameter callable. See the
|
764
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.
|
812
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.7.0/Tabulo/Table#initialize-instance_method)
|
765
813
|
for details.
|
766
814
|
|
767
815
|
<a name="styling-borders"></a>
|
@@ -956,7 +1004,7 @@ a new table in which the rows and columns are swapped:
|
|
956
1004
|
By default, a header row is added to the new table, showing the string value of the element
|
957
1005
|
represented in that column. This can be configured, however, along with other aspects of
|
958
1006
|
`transpose`’s behaviour. For details, see the
|
959
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/2.
|
1007
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/2.7.0/Tabulo/Table#transpose-instance_method).
|
960
1008
|
|
961
1009
|
<a name="borders"></a>
|
962
1010
|
### Configuring borders [↑](#contents)
|
@@ -1012,6 +1060,10 @@ This is done using the `border` option passed to `Table.new`. The options are as
|
|
1012
1060
|
└──────────────┴──────────────┴──────────────┘
|
1013
1061
|
```
|
1014
1062
|
|
1063
|
+
_Note: The unicode characters used for the `:modern` border may not render properly
|
1064
|
+
when viewing this documentation on some browsers or devices. This doesn’t reflect any brokenness
|
1065
|
+
in `tabulo` itself._
|
1066
|
+
|
1015
1067
|
`:markdown`—renders a GitHub flavoured Markdown table:
|
1016
1068
|
|
1017
1069
|
```
|
@@ -1101,6 +1153,10 @@ generally support adding a caption (i.e. title) element to tables.
|
|
1101
1153
|
────────────── ────────────── ──────────────
|
1102
1154
|
```
|
1103
1155
|
|
1156
|
+
_Note: The unicode characters used for the `:reduced_modern` border may not render properly
|
1157
|
+
when viewing this documentation on some browsers or devices. This doesn’t reflect any brokenness
|
1158
|
+
in `tabulo` itself._
|
1159
|
+
|
1104
1160
|
`:classic`—reproduces the default behaviour in Tabulo v1; this is like the `:ascii` option,
|
1105
1161
|
but without a bottom border:
|
1106
1162
|
|
@@ -1154,16 +1210,16 @@ every Nth row. For example:
|
|
1154
1210
|
If you want a line before every row, pass `1` to `row_divider_frequency`. For example:
|
1155
1211
|
|
1156
1212
|
```
|
1157
|
-
> puts Tabulo::Table.new(1..3, :itself, :even?, :odd?,
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1213
|
+
> puts Tabulo::Table.new(1..3, :itself, :even?, :odd?, row_divider_frequency: 1)
|
1214
|
+
+--------------+--------------+--------------+
|
1215
|
+
| itself | even? | odd? |
|
1216
|
+
+--------------+--------------+--------------+
|
1217
|
+
| 1 | false | true |
|
1218
|
+
+--------------+--------------+--------------+
|
1219
|
+
| 2 | true | false |
|
1220
|
+
+--------------+--------------+--------------+
|
1221
|
+
| 3 | false | true |
|
1222
|
+
+--------------+--------------+--------------+
|
1167
1223
|
```
|
1168
1224
|
|
1169
1225
|
<a name="freezing-a-table"></a>
|
@@ -1339,15 +1395,15 @@ The gem is available as open source under the terms of the [MIT
|
|
1339
1395
|
License](http://opensource.org/licenses/MIT).
|
1340
1396
|
|
1341
1397
|
[Gem Version]: https://rubygems.org/gems/tabulo
|
1342
|
-
[Documentation]: http://www.rubydoc.info/gems/tabulo/2.
|
1343
|
-
[Build Status]: https://
|
1344
|
-
[Coverage Status]: https://coveralls.io/
|
1398
|
+
[Documentation]: http://www.rubydoc.info/gems/tabulo/2.7.0
|
1399
|
+
[Build Status]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml
|
1400
|
+
[Coverage Status]: https://coveralls.io/github/matt-harvey/tabulo
|
1345
1401
|
[Code Climate]: https://codeclimate.com/github/matt-harvey/tabulo
|
1346
1402
|
[Awesome Ruby]: https://github.com/markets/awesome-ruby#cli-utilities
|
1347
1403
|
|
1348
1404
|
[GV img]: https://img.shields.io/gem/v/tabulo.svg
|
1349
|
-
[DC img]: https://img.shields.io/badge/documentation-v2.
|
1350
|
-
[BS img]: https://
|
1405
|
+
[DC img]: https://img.shields.io/badge/documentation-v2.7.0-blue.svg
|
1406
|
+
[BS img]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml/badge.svg
|
1351
1407
|
[CS img]: https://img.shields.io/coveralls/matt-harvey/tabulo.svg
|
1352
1408
|
[CC img]: https://codeclimate.com/github/matt-harvey/tabulo/badges/gpa.svg
|
1353
1409
|
[AR img]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.0
|
data/lib/tabulo/cell.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require "unicode/display_width"
|
2
4
|
|
3
5
|
module Tabulo
|
@@ -19,6 +21,7 @@ module Tabulo
|
|
19
21
|
styler:,
|
20
22
|
truncation_indicator:,
|
21
23
|
value:,
|
24
|
+
wrap_preserve:,
|
22
25
|
width:)
|
23
26
|
|
24
27
|
@alignment = alignment
|
@@ -30,6 +33,7 @@ module Tabulo
|
|
30
33
|
@styler = styler
|
31
34
|
@truncation_indicator = truncation_indicator
|
32
35
|
@value = value
|
36
|
+
@wrap_preserve = wrap_preserve
|
33
37
|
@width = width
|
34
38
|
end
|
35
39
|
|
@@ -100,30 +104,86 @@ module Tabulo
|
|
100
104
|
end
|
101
105
|
|
102
106
|
def calculate_subcells
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
subsubcell_width
|
112
|
-
|
113
|
-
|
107
|
+
case @wrap_preserve
|
108
|
+
when :rune
|
109
|
+
line_index = 0
|
110
|
+
formatted_content.split(Util::NEWLINE, -1).flat_map do |substr|
|
111
|
+
subsubcells, subsubcell, subsubcell_width = [], String.new(""), 0
|
112
|
+
|
113
|
+
substr.scan(/\X/).each do |rune|
|
114
|
+
rune_width = Unicode::DisplayWidth.of(rune)
|
115
|
+
if subsubcell_width + rune_width > @width
|
116
|
+
subsubcells << style_and_align_cell_content(subsubcell, line_index)
|
117
|
+
subsubcell_width = 0
|
118
|
+
subsubcell.clear
|
119
|
+
line_index += 1
|
120
|
+
end
|
121
|
+
|
122
|
+
subsubcell << rune
|
123
|
+
subsubcell_width += rune_width
|
114
124
|
end
|
115
125
|
|
116
|
-
|
117
|
-
|
126
|
+
subsubcells << style_and_align_cell_content(subsubcell, line_index)
|
127
|
+
line_index += 1
|
128
|
+
subsubcells
|
118
129
|
end
|
130
|
+
when :word
|
131
|
+
line_index = 0
|
132
|
+
formatted_content.split(Util::NEWLINE, -1).flat_map do |substr|
|
133
|
+
subsubcells, subsubcell, subsubcell_width = [], String.new(""), 0
|
134
|
+
|
135
|
+
substr.split(/(?<= |\-|\—|\–)\b/).each do |word|
|
136
|
+
# Each word looks like "this " or like "this-".
|
137
|
+
word_width = Unicode::DisplayWidth.of(word)
|
138
|
+
combined_width = subsubcell_width + word_width
|
139
|
+
if combined_width - 1 == @width && word[-1] == " "
|
140
|
+
# do nothing, as we're on the final word of the line and
|
141
|
+
# the space at the end will be chopped off.
|
142
|
+
elsif combined_width > @width
|
143
|
+
content = style_and_align_cell_content(subsubcell, line_index)
|
144
|
+
if content.strip.length != 0
|
145
|
+
subsubcells << content
|
146
|
+
subsubcell_width = 0
|
147
|
+
subsubcell.clear
|
148
|
+
line_index += 1
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
if word_width >= @width
|
153
|
+
word.scan(/\X/).each do |rune|
|
154
|
+
rune_width = Unicode::DisplayWidth.of(rune)
|
155
|
+
if subsubcell_width + rune_width > @width
|
156
|
+
if rune != " "
|
157
|
+
content = style_and_align_cell_content(subsubcell, line_index)
|
158
|
+
subsubcells << content
|
159
|
+
subsubcell_width = 0
|
160
|
+
subsubcell.clear
|
161
|
+
line_index += 1
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
subsubcell << rune
|
166
|
+
subsubcell_width += rune_width
|
167
|
+
end
|
168
|
+
else
|
169
|
+
subsubcell << word
|
170
|
+
subsubcell_width += word_width
|
171
|
+
end
|
172
|
+
end
|
119
173
|
|
120
|
-
|
121
|
-
|
122
|
-
|
174
|
+
content = style_and_align_cell_content(subsubcell, line_index)
|
175
|
+
subsubcells << content
|
176
|
+
line_index += 1
|
177
|
+
subsubcells
|
178
|
+
end
|
123
179
|
end
|
124
180
|
end
|
125
181
|
|
126
182
|
def style_and_align_cell_content(content, line_index)
|
183
|
+
if @wrap_preserve == :word
|
184
|
+
content.strip!
|
185
|
+
end
|
186
|
+
|
127
187
|
padding = Util.max(@width - Unicode::DisplayWidth.of(content), 0)
|
128
188
|
left_padding, right_padding =
|
129
189
|
case real_alignment
|
data/lib/tabulo/column.rb
CHANGED
@@ -22,6 +22,7 @@ module Tabulo
|
|
22
22
|
right_padding:,
|
23
23
|
styler:,
|
24
24
|
truncation_indicator:,
|
25
|
+
wrap_preserve:,
|
25
26
|
width:)
|
26
27
|
|
27
28
|
@align_body = align_body
|
@@ -50,6 +51,7 @@ module Tabulo
|
|
50
51
|
@padding_character = padding_character
|
51
52
|
@styler = styler || -> (_, s) { s }
|
52
53
|
@truncation_indicator = truncation_indicator
|
54
|
+
@wrap_preserve = wrap_preserve
|
53
55
|
@width = width
|
54
56
|
end
|
55
57
|
|
@@ -67,6 +69,7 @@ module Tabulo
|
|
67
69
|
styler: @header_styler,
|
68
70
|
truncation_indicator: @truncation_indicator,
|
69
71
|
value: @header,
|
72
|
+
wrap_preserve: @wrap_preserve,
|
70
73
|
width: @width,
|
71
74
|
)
|
72
75
|
end
|
@@ -85,6 +88,7 @@ module Tabulo
|
|
85
88
|
styler: @styler,
|
86
89
|
truncation_indicator: @truncation_indicator,
|
87
90
|
value: body_cell_value(source, row_index: row_index, column_index: column_index),
|
91
|
+
wrap_preserve: @wrap_preserve,
|
88
92
|
width: @width,
|
89
93
|
)
|
90
94
|
end
|
data/lib/tabulo/table.rb
CHANGED
@@ -35,17 +35,17 @@ module Tabulo
|
|
35
35
|
# be unique. Each element of the Array will be used to create a column whose content is
|
36
36
|
# created by calling the corresponding method on each element of sources. Note
|
37
37
|
# the {#add_column} method is a much more flexible way to set up columns on the table.
|
38
|
-
# @param [:left, :right, :center, :auto] align_body
|
38
|
+
# @param [:left, :right, :center, :auto] align_body Determines the alignment of body cell
|
39
39
|
# (i.e. non-header) content within columns in this Table. Can be overridden for individual columns
|
40
40
|
# using the <tt>align_body</tt> option passed to {#add_column}. If passed <tt>:auto</tt>,
|
41
41
|
# alignment is determined by cell content, with numbers aligned right, booleans
|
42
42
|
# center-aligned, and other values left-aligned.
|
43
|
-
# @param [:left, :right, :center] align_header
|
43
|
+
# @param [:left, :right, :center] align_header Determines the alignment of header text
|
44
44
|
# for columns in this Table. Can be overridden for individual columns using the
|
45
45
|
# <tt>align_header</tt> option passed to {#add_column}
|
46
|
-
# @param [:left, :right, :center] align_header
|
46
|
+
# @param [:left, :right, :center] align_header Determines the alignment of the table
|
47
47
|
# title, if present.
|
48
|
-
# @param [:ascii, :markdown, :modern, :blank, nil] border
|
48
|
+
# @param [:ascii, :markdown, :modern, :blank, nil] border Determines the characters used
|
49
49
|
# for the Table border, including both the characters around the outside of table, and the lines drawn
|
50
50
|
# within the table to separate columns from each other and the header row from the Table body.
|
51
51
|
# If <tt>nil</tt>, then the value of {DEFAULT_BORDER} will be used.
|
@@ -63,7 +63,7 @@ module Tabulo
|
|
63
63
|
# borders and intersection characters consisting of whitespace only
|
64
64
|
# - `:classic` Like `:ascii`, but does not have a horizontal line at the bottom of the
|
65
65
|
# table. This reproduces the default behaviour in `tabulo` v1.
|
66
|
-
# @param [nil, #to_proc] border_styler
|
66
|
+
# @param [nil, #to_proc] border_styler A lambda or other callable object taking
|
67
67
|
# a single parameter, representing a section of the table's borders (which for this purpose
|
68
68
|
# include any horizontal and vertical lines inside the table), and returning a string.
|
69
69
|
# If passed <tt>nil</tt>, then no additional styling will be applied to borders. If passed a
|
@@ -72,7 +72,7 @@ module Tabulo
|
|
72
72
|
# <tt>border_styler</tt> is not taken into consideration by the internal table rendering calculations
|
73
73
|
# Thus it can be used to apply ANSI escape codes to border characters, to colour the borders
|
74
74
|
# for example, without breaking the table formatting.
|
75
|
-
# @param [nil, Integer, Array] column_padding
|
75
|
+
# @param [nil, Integer, Array] column_padding Determines the amount of blank space with which to pad
|
76
76
|
# either side of each column. If passed an Integer, then the given amount of padding is
|
77
77
|
# applied to each side of each column. If passed a two-element Array, then the first element of the
|
78
78
|
# Array indicates the amount of padding to apply to the left of each column, and the second
|
@@ -80,26 +80,26 @@ module Tabulo
|
|
80
80
|
# individual columns using the `padding` option of {#add_column}.
|
81
81
|
# @param [Integer, nil] column_width The default column width for columns in this
|
82
82
|
# table, not excluding padding. If <tt>nil</tt>, then {DEFAULT_COLUMN_WIDTH} will be used.
|
83
|
-
# @param [nil, #to_proc] formatter
|
83
|
+
# @param [nil, #to_proc] formatter The default formatter for columns in this
|
84
84
|
# table. See `formatter` option of {#add_column} for details.
|
85
85
|
# @param [:start, nil, Integer] header_frequency (:start) Controls the display of column headers.
|
86
86
|
# If passed <tt>:start</tt>, headers will be shown at the top of the table only. If passed <tt>nil</tt>,
|
87
87
|
# headers will not be shown. If passed an Integer N (> 0), headers will be shown at the top of the table,
|
88
88
|
# then repeated every N rows.
|
89
|
-
# @param [nil, #to_proc] header_styler
|
89
|
+
# @param [nil, #to_proc] header_styler The default header styler for columns in this
|
90
90
|
# table. See `header_styler` option of {#add_column} for details.
|
91
|
-
# @param [nil, Integer] row_divider_frequency
|
91
|
+
# @param [nil, Integer] row_divider_frequency Controls the display of horizontal row dividers within
|
92
92
|
# the table body. If passed <tt>nil</tt>, dividers will not be shown. If passed an Integer N (> 0),
|
93
93
|
# dividers will be shown after every N rows. The characters used to form the dividers are
|
94
94
|
# determined by the `border` option, and are the same as those used to form the bottom edge of the
|
95
95
|
# header row.
|
96
|
-
# @param [nil, #to_proc] styler
|
96
|
+
# @param [nil, #to_proc] styler The default styler for columns in this table. See `styler`
|
97
97
|
# option of {#add_column} for details.
|
98
|
-
# @param [nil, String] title
|
98
|
+
# @param [nil, String] title If passed a String, will arrange for a title to be shown at the top
|
99
99
|
# of the table. Note: If the `border` option is set to `:markdown`, adding a title to the table
|
100
100
|
# will cause it to cease being valid Markdown when rendered, since Markdown engines do not generally
|
101
101
|
# support adding a caption element (i.e. title) to tables.
|
102
|
-
# @param [nil, #to_proc] title_styler
|
102
|
+
# @param [nil, #to_proc] title_styler A lambda or other callable object that will
|
103
103
|
# determine the colors or other styling applied to the table title. Can be passed
|
104
104
|
# <tt>nil</tt>, or can be passed a callable that takes either 1 or 2 parametes:
|
105
105
|
# * If passed <tt>nil</tt>, then no additional styling will be applied to the title.
|
@@ -124,6 +124,16 @@ module Tabulo
|
|
124
124
|
# cell's content has been truncated. If omitted or passed <tt>nil</tt>,
|
125
125
|
# defaults to {DEFAULT_TRUNCATION_INDICATOR}. If passed something other than <tt>nil</tt> or
|
126
126
|
# a single-character String, raises {InvalidTruncationIndicatorError}.
|
127
|
+
# @param [Symbol] wrap_preserve Specifies what unit of text the wrapping mechanism will try to
|
128
|
+
# preserve intact when wrapping column content when the column width is reached.
|
129
|
+
# * If passed `:rune` (the default), then it will wrap at the "character" level (approximately
|
130
|
+
# speaking, the Unicode grapheme cluster level). This means the maximum number of what
|
131
|
+
# readers usually think of as "characters" will be fit on each line, within the column's allocated
|
132
|
+
# width, before contininuing to a new line, even if it means splitting a word in the middle.
|
133
|
+
# * If passed `:word`, then it will wrap in such a way as to avoid splitting words, where
|
134
|
+
# "words" are defined as units of text separated by spaces or dashes (hyphens, m-dashes and
|
135
|
+
# n-dashes). Whitespace will be used to pad lines as required. Already-hyphenated may will be split
|
136
|
+
# at the hyphen, however hyphens will not be inserted in non-hyphenated words.
|
127
137
|
# @param [nil, Integer] wrap_body_cells_to Controls wrapping behaviour for table cells (excluding
|
128
138
|
# headers), if their content is longer than the column's fixed width. If passed <tt>nil</tt>, content will
|
129
139
|
# be wrapped for as many rows as required to accommodate it. If passed an Integer N (> 0), content will be
|
@@ -141,7 +151,7 @@ module Tabulo
|
|
141
151
|
def initialize(sources, *columns, align_body: :auto, align_header: :center, align_title: :center,
|
142
152
|
border: nil, border_styler: nil, column_padding: nil, column_width: nil, formatter: :to_s.to_proc,
|
143
153
|
header_frequency: :start, header_styler: nil, row_divider_frequency: nil, styler: nil,
|
144
|
-
title: nil, title_styler: nil, truncation_indicator: nil, wrap_body_cells_to: nil,
|
154
|
+
title: nil, title_styler: nil, truncation_indicator: nil, wrap_preserve: :rune, wrap_body_cells_to: nil,
|
145
155
|
wrap_header_cells_to: nil)
|
146
156
|
|
147
157
|
@sources = sources
|
@@ -167,6 +177,7 @@ module Tabulo
|
|
167
177
|
@title_styler = title_styler
|
168
178
|
@truncation_indicator = validate_character(truncation_indicator,
|
169
179
|
DEFAULT_TRUNCATION_INDICATOR, InvalidTruncationIndicatorError, "truncation indicator")
|
180
|
+
@wrap_preserve = wrap_preserve
|
170
181
|
@wrap_body_cells_to = wrap_body_cells_to
|
171
182
|
@wrap_header_cells_to = wrap_header_cells_to
|
172
183
|
|
@@ -184,24 +195,24 @@ module Tabulo
|
|
184
195
|
# a method to be called on each item in the table sources to provide the content
|
185
196
|
# for this column. If a String is passed as the label, then it will be converted to
|
186
197
|
# a Symbol for the purpose of serving as this label.
|
187
|
-
# @param [:left, :center, :right, :auto, nil] align_body
|
198
|
+
# @param [:left, :center, :right, :auto, nil] align_body Specifies how the cell body contents
|
188
199
|
# should be aligned. If <tt>nil</tt> is passed, then the alignment is determined
|
189
200
|
# by the Table-level setting passed to the <tt>align_body</tt> option on Table initialization
|
190
201
|
# (which itself defaults to <tt>:auto</tt>). Otherwise this option determines the alignment of
|
191
202
|
# this column. If <tt>:auto</tt> is passed, the alignment is determined by the type of the cell
|
192
203
|
# value, with numbers aligned right, booleans center-aligned, and other values left-aligned.
|
193
204
|
# Note header text alignment is configured separately using the :align_header param.
|
194
|
-
# @param [:left, :center, :right, nil] align_header
|
205
|
+
# @param [:left, :center, :right, nil] align_header Specifies how the header text
|
195
206
|
# should be aligned. If <tt>nil</tt> is passed, then the alignment is determined
|
196
207
|
# by the Table-level setting passed to the <tt>align_header</tt> (which itself defaults
|
197
208
|
# to <tt>:center</tt>). Otherwise, this option determines the alignment of the header
|
198
209
|
# content for this column.
|
199
|
-
# @param [Symbol, String, Integer, nil] before
|
210
|
+
# @param [Symbol, String, Integer, nil] before The label of the column before (i.e. to
|
200
211
|
# the left of) which the new column should inserted. If <tt>nil</tt> is passed, it will be
|
201
212
|
# inserted after all other columns. If there is no column with the given label, then an
|
202
213
|
# {InvalidColumnLabelError} will be raised. A non-Integer labelled column can be identified
|
203
214
|
# in either String or Symbol form for this purpose.
|
204
|
-
# @param [#to_proc] formatter
|
215
|
+
# @param [#to_proc] formatter A lambda or other callable object that
|
205
216
|
# will be passed the calculated value of each cell to determine how it should be displayed. This
|
206
217
|
# is distinct from the extractor and the styler (see below).
|
207
218
|
# For example, if the extractor for this column generates a Date, then the formatter might format
|
@@ -219,7 +230,7 @@ module Tabulo
|
|
219
230
|
# whether the {Cell} is an odd- or even-numbered {Row}, to arrange for different formatting
|
220
231
|
# to be applied to alternating rows.
|
221
232
|
# See the documentation for {CellData} for more.
|
222
|
-
# @param [nil, #to_s] header
|
233
|
+
# @param [nil, #to_s] header Text to be displayed in the column header. If passed nil,
|
223
234
|
# the column's label will also be used as its header text.
|
224
235
|
# @param [nil, #to_proc] header_styler (nil) A lambda or other callable object that will
|
225
236
|
# determine the colors or other styling applied to the header content. Can be passed
|
@@ -249,14 +260,14 @@ module Tabulo
|
|
249
260
|
#
|
250
261
|
# Note that if the header content is truncated, then any <tt>header_styler</tt> will be applied to the
|
251
262
|
# truncation indicator character as well as to the truncated content.
|
252
|
-
# @param [nil, Integer, Array] padding
|
263
|
+
# @param [nil, Integer, Array] padding Determines the amount of blank space with which to
|
253
264
|
# pad either side of the column. If passed nil, then the `column_padding` setting of the
|
254
265
|
# {Table} will determine the column's padding. (See {#initialize}.) Otherwise, this option
|
255
266
|
# overrides, for this column, the `column_padding` that was set at the table level: if passed an Integer,
|
256
267
|
# then the given amount of padding is applied to either side of the column; or if passed a two-element Array,
|
257
268
|
# then the first element of the Array indicates the amount of padding to apply to the left of the column,
|
258
269
|
# and the second element indicates the amount to apply to the right.
|
259
|
-
# @param [nil, #to_proc] styler
|
270
|
+
# @param [nil, #to_proc] styler A lambda or other callable object that will determine
|
260
271
|
# the colors or other styling applied to the formatted value of the cell. Can be passed
|
261
272
|
# <tt>nil</tt>, or can be passed a callable that takes either 2 or 3 parameters:
|
262
273
|
# * If passed <tt>nil</tt>, then no additional styling will be applied to the cell content
|
@@ -288,9 +299,14 @@ module Tabulo
|
|
288
299
|
#
|
289
300
|
# Note that if the content of a cell is truncated, then the whatever styling is applied by the
|
290
301
|
# <tt>styler</tt> to the cell content will also be applied to the truncation indicator character.
|
291
|
-
# @param [Integer] width
|
302
|
+
# @param [Integer] width Specifies the width of the column, excluding padding. If
|
292
303
|
# nil, then the column will take the width provided by the `column_width` param
|
293
304
|
# with which the Table was initialized.
|
305
|
+
# @param [Symbol] wrap_preserve Specifies how to wrap column content when the column width is reached.
|
306
|
+
# * If passed `nil`, or not provided, then the value passed to the `wrap_preserve` param of
|
307
|
+
# {#initialize} will be used.
|
308
|
+
# * If passed `rune` or word, then the option passed to {#initialize} will be overridden for
|
309
|
+
# this column. See the documentation under {#initialize} for the behaviour of each option.
|
294
310
|
# @param [#to_proc] extractor A block or other callable that will be passed each of the {Table}
|
295
311
|
# sources to determine the value in each cell of this column.
|
296
312
|
# * If this is not provided, then the column label will be treated as a method to be called on
|
@@ -305,7 +321,7 @@ module Tabulo
|
|
305
321
|
# Table. (This is case-sensitive, but is insensitive to whether a String or Symbol is passed
|
306
322
|
# to the label parameter.)
|
307
323
|
def add_column(label, align_body: nil, align_header: nil, before: nil, formatter: nil,
|
308
|
-
header: nil, header_styler: nil, padding: nil, styler: nil, width: nil, &extractor)
|
324
|
+
header: nil, header_styler: nil, padding: nil, styler: nil, width: nil, wrap_preserve: nil, &extractor)
|
309
325
|
|
310
326
|
column_label = normalize_column_label(label)
|
311
327
|
|
@@ -333,6 +349,7 @@ module Tabulo
|
|
333
349
|
right_padding: right_padding,
|
334
350
|
styler: styler || @styler,
|
335
351
|
truncation_indicator: @truncation_indicator,
|
352
|
+
wrap_preserve: wrap_preserve || @wrap_preserve,
|
336
353
|
width: width || @column_width,
|
337
354
|
)
|
338
355
|
|
@@ -412,7 +429,7 @@ module Tabulo
|
|
412
429
|
# Produce a horizontal dividing line suitable for printing at the top, bottom or middle
|
413
430
|
# of the table.
|
414
431
|
#
|
415
|
-
# @param [:top, :middle, :bottom, :title_top, :title_bottom] position
|
432
|
+
# @param [:top, :middle, :bottom, :title_top, :title_bottom] position
|
416
433
|
# Specifies the position for which the resulting horizontal dividing line is intended to
|
417
434
|
# be printed. This determines the border characters that are used to construct the line.
|
418
435
|
# The `:title_top` and `:title_bottom` options are used internally for adding borders
|
@@ -451,7 +468,7 @@ module Tabulo
|
|
451
468
|
# is called. If the source Enumerable changes between that point, and the point when
|
452
469
|
# the Table is printed, then columns will *not* be resized yet again on printing.
|
453
470
|
#
|
454
|
-
# @param [nil, Numeric] max_table_width
|
471
|
+
# @param [nil, Numeric] max_table_width With no args, or if passed <tt>:auto</tt>,
|
455
472
|
# stops the total table width (including padding and borders) from expanding beyond the
|
456
473
|
# bounds of the terminal screen.
|
457
474
|
# If passed <tt>nil</tt>, the table width will not be capped.
|
@@ -523,13 +540,13 @@ module Tabulo
|
|
523
540
|
# new Table, which contains the names of "fields" (corresponding to the original Table's
|
524
541
|
# column headings). If this is not provided, then by default this column will be made just
|
525
542
|
# wide enough to accommodate its contents.
|
526
|
-
# @option opts [String] :field_names_header
|
543
|
+
# @option opts [String] :field_names_header By default the left-most column will have a
|
527
544
|
# blank header; but this can be overridden by passing a String to this option.
|
528
|
-
# @option opts [:left, :center, :right] :field_names_header_alignment
|
545
|
+
# @option opts [:left, :center, :right] :field_names_header_alignment Specifies how the
|
529
546
|
# header text of the left-most column (if it has header text) should be aligned.
|
530
|
-
# @option opts [:left, :center, :right] :field_names_body_alignment
|
547
|
+
# @option opts [:left, :center, :right] :field_names_body_alignment Specifies how the
|
531
548
|
# body text of the left-most column should be aligned.
|
532
|
-
# @option opts [#to_proc] :headers
|
549
|
+
# @option opts [#to_proc] :headers A lambda or other callable object that
|
533
550
|
# will be passed in turn each of the elements of the current Table's <tt>sources</tt>
|
534
551
|
# Enumerable, to determine the text to be displayed in the header of each column of the
|
535
552
|
# new Table (other than the left-most column's header, which is determined as described
|
@@ -651,7 +668,8 @@ module Tabulo
|
|
651
668
|
styler: styler,
|
652
669
|
truncation_indicator: @truncation_indicator,
|
653
670
|
value: @title,
|
654
|
-
width: title_cell_width
|
671
|
+
width: title_cell_width,
|
672
|
+
wrap_preserve: @wrap_preserve,
|
655
673
|
)
|
656
674
|
cells = [title_cell]
|
657
675
|
max_cell_height = cells.map(&:height).max
|
data/lib/tabulo/util.rb
CHANGED
@@ -3,6 +3,8 @@ module Tabulo
|
|
3
3
|
# @!visibility private
|
4
4
|
module Util
|
5
5
|
|
6
|
+
NEWLINE = /\r\n|\n|\r/
|
7
|
+
|
6
8
|
# @!visibility private
|
7
9
|
def self.condense_lines(lines)
|
8
10
|
join_lines(lines.reject(&:empty?))
|
@@ -34,7 +36,7 @@ module Tabulo
|
|
34
36
|
# @return [Integer] the length of the longest segment of str when split by newlines
|
35
37
|
def self.wrapped_width(str)
|
36
38
|
return 0 if str.empty?
|
37
|
-
segments = str.split(
|
39
|
+
segments = str.split(NEWLINE)
|
38
40
|
segments.inject(1) do |longest_length_so_far, segment|
|
39
41
|
Util.max(longest_length_so_far, Unicode::DisplayWidth.of(segment))
|
40
42
|
end
|
data/lib/tabulo/version.rb
CHANGED
data/tabulo.gemspec
CHANGED
@@ -28,14 +28,14 @@ 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.
|
32
|
-
spec.add_runtime_dependency "unicode-display_width", "
|
31
|
+
spec.add_runtime_dependency "tty-screen", "0.8.1"
|
32
|
+
spec.add_runtime_dependency "unicode-display_width", "2.0.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
|
-
spec.add_development_dependency "
|
38
|
+
spec.add_development_dependency "simplecov-lcov"
|
39
39
|
spec.add_development_dependency "yard"
|
40
40
|
spec.add_development_dependency "redcarpet"
|
41
41
|
spec.add_development_dependency "github-markup"
|
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.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Harvey
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|
@@ -16,28 +16,28 @@ 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
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.0.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:
|
40
|
+
version: 2.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
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
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: simplecov-lcov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -172,10 +172,11 @@ extensions: []
|
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
174
|
- ".ackrc"
|
175
|
+
- ".github/workflows/tests.yml"
|
175
176
|
- ".gitignore"
|
176
177
|
- ".rdoc_options"
|
177
178
|
- ".rspec"
|
178
|
-
- ".
|
179
|
+
- ".simplecov"
|
179
180
|
- ".yardopts"
|
180
181
|
- CHANGELOG.md
|
181
182
|
- Gemfile
|
@@ -205,7 +206,7 @@ licenses:
|
|
205
206
|
metadata:
|
206
207
|
source_code_uri: https://github.com/matt-harvey/tabulo
|
207
208
|
changelog_uri: https://raw.githubusercontent.com/matt-harvey/tabulo/master/CHANGELOG.md
|
208
|
-
post_install_message:
|
209
|
+
post_install_message:
|
209
210
|
rdoc_options: []
|
210
211
|
require_paths:
|
211
212
|
- lib
|
@@ -221,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
222
|
version: '0'
|
222
223
|
requirements: []
|
223
224
|
rubygems_version: 3.1.2
|
224
|
-
signing_key:
|
225
|
+
signing_key:
|
225
226
|
specification_version: 4
|
226
227
|
summary: Terminal table generator
|
227
228
|
test_files: []
|