tabulo 2.8.2 → 3.0.1
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 +4 -4
- data/.github/workflows/tests.yml +4 -9
- data/CHANGELOG.md +12 -0
- data/README.md +8 -8
- data/Rakefile +0 -6
- data/VERSION +1 -1
- data/lib/tabulo/column.rb +2 -6
- data/lib/tabulo/util.rb +4 -12
- data/lib/tabulo/version.rb +1 -1
- data/tabulo.gemspec +5 -6
- metadata +14 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82b707a4b6a0e56d6c91cf983c53df929b418b7e2d5b8759af5361df9d41c919
|
4
|
+
data.tar.gz: 476897e017466a4a0ae0ba0a205cae7470d9cc9addb040599edad4827eb90638
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40ad2978c7da37070cd58d7903c91b231b8c828c8ae7f7cb3d9759b402fe72b2c26092ec965e80186c81b8c421ed97f85ead42f0489cc4dd7b289836b633f20a
|
7
|
+
data.tar.gz: 3256e3e277f2aebe5fd933437d6beaddcf329e0d0e8bee9697a38804e6721761ef2e6232c59e73134d1bc6c2d667f7de614a3f0f3fc7d830af0215e3736adb91
|
data/.github/workflows/tests.yml
CHANGED
@@ -19,15 +19,9 @@ jobs:
|
|
19
19
|
strategy:
|
20
20
|
matrix:
|
21
21
|
ruby-version: [
|
22
|
-
'
|
23
|
-
'2.3
|
24
|
-
'
|
25
|
-
'2.5.9',
|
26
|
-
'2.6.10',
|
27
|
-
'2.7.7',
|
28
|
-
'3.0.5',
|
29
|
-
'3.1.3',
|
30
|
-
'3.2.0',
|
22
|
+
'3.1.4',
|
23
|
+
'3.2.3',
|
24
|
+
'3.3.0',
|
31
25
|
]
|
32
26
|
steps:
|
33
27
|
- uses: actions/checkout@v3
|
@@ -37,6 +31,7 @@ jobs:
|
|
37
31
|
uses: ruby/setup-ruby@v1 # Was: uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
38
32
|
with:
|
39
33
|
ruby-version: ${{ matrix.ruby-version }}
|
34
|
+
bundler: 2.4.14
|
40
35
|
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
41
36
|
- name: Run tests
|
42
37
|
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### v3.0.1
|
4
|
+
|
5
|
+
* Upgrade dependency versions
|
6
|
+
* Cover Ruby 3.3 in CI config
|
7
|
+
|
8
|
+
### v3.0.0
|
9
|
+
|
10
|
+
* Require Ruby >= 3.1
|
11
|
+
* Upgrade dependency versions
|
12
|
+
* Remove "rake-version" development dependency; it's not essential, and doesn't
|
13
|
+
currently work with Ruby 3.2.
|
14
|
+
|
3
15
|
### v2.8.2
|
4
16
|
|
5
17
|
* Relax dependencies to address incompatibility with recent Rubocop version.
|
data/README.md
CHANGED
@@ -544,8 +544,8 @@ linebreaks in your data. When using this option, other columns might be shrunk m
|
|
544
544
|
the table fit within the `max_table_width`.
|
545
545
|
|
546
546
|
For even finer-grained control over column and table resizing, see the
|
547
|
-
for the [`#autosize_columns`](https://www.rubydoc.info/gems/tabulo/
|
548
|
-
and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/
|
547
|
+
for the [`#autosize_columns`](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#autosize_columns-instance_method)
|
548
|
+
and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#shrink_to-instance_method) methods.
|
549
549
|
|
550
550
|
Note that `pack`ing the table necessarily involves traversing the entire collection up front as
|
551
551
|
the maximum cell width needs to be calculated for each column. You may not want to do this
|
@@ -810,7 +810,7 @@ the table.
|
|
810
810
|
The `formatter` callback also has an alternative, 2-parameter version. If `formatter` is passed
|
811
811
|
a 2-parameter callable, the second parameter will be given a `CellData` instance,
|
812
812
|
containing additional information about the cell that may be useful in determining how to format
|
813
|
-
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/
|
813
|
+
it—see the [documentation](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/CellData.html)
|
814
814
|
for details.
|
815
815
|
|
816
816
|
<a name="colours-and-styling"></a>
|
@@ -856,7 +856,7 @@ number is even). The second parameter represents the formatted string value of t
|
|
856
856
|
content after any processing by the [formatter](#formatting-cell-values). The third and fourth
|
857
857
|
parameters are optional, and contain further information about the cell and its contents that may be useful in
|
858
858
|
determining how to style it. See the
|
859
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/
|
859
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#add_column-instance_method) for details.
|
860
860
|
|
861
861
|
If the content of a cell is wrapped over multiple lines, then the `styler` will be called once
|
862
862
|
per line, so that each line of the cell will have the escape sequence applied to it separately
|
@@ -876,7 +876,7 @@ table.add_column(:even?, header_styler: -> (s) { "\033[32m#{s}\033[0m" })
|
|
876
876
|
```
|
877
877
|
|
878
878
|
The `header_styler` option accepts a 1-, 2- or 3-parameter callable. See the
|
879
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/
|
879
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#add_column-instance_method)
|
880
880
|
for details.
|
881
881
|
|
882
882
|
<a name="styling-title"></a>
|
@@ -890,7 +890,7 @@ table = Tabulo::Table.new(1..5, :itself, :even?, :odd?, title: "Numbers", title_
|
|
890
890
|
```
|
891
891
|
|
892
892
|
The `title_styler` option accepts a 1- or 2-parameter callable. See the
|
893
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/
|
893
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#initialize-instance_method)
|
894
894
|
for details.
|
895
895
|
|
896
896
|
<a name="styling-borders"></a>
|
@@ -1091,7 +1091,7 @@ a new table in which the rows and columns are swapped:
|
|
1091
1091
|
By default, a header row is added to the new table, showing the string value of the element
|
1092
1092
|
represented in that column. This can be configured, however, along with other aspects of
|
1093
1093
|
`transpose`’s behaviour. For details, see the
|
1094
|
-
[documentation](https://www.rubydoc.info/gems/tabulo/
|
1094
|
+
[documentation](https://www.rubydoc.info/gems/tabulo/3.0.1/Tabulo/Table#transpose-instance_method).
|
1095
1095
|
|
1096
1096
|
<a name="borders"></a>
|
1097
1097
|
### Configuring borders [↑](#contents)
|
@@ -1494,7 +1494,7 @@ License](http://opensource.org/licenses/MIT).
|
|
1494
1494
|
[Awesome Ruby]: https://github.com/markets/awesome-ruby#cli-utilities
|
1495
1495
|
|
1496
1496
|
[GV img]: https://img.shields.io/gem/v/tabulo.svg
|
1497
|
-
[DC img]: https://img.shields.io/badge/documentation-
|
1497
|
+
[DC img]: https://img.shields.io/badge/documentation-v3.0.1-blue.svg
|
1498
1498
|
[BS img]: https://github.com/matt-harvey/tabulo/actions/workflows/tests.yml/badge.svg
|
1499
1499
|
[CS img]: https://img.shields.io/coveralls/matt-harvey/tabulo.svg
|
1500
1500
|
[AR img]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
|
data/Rakefile
CHANGED
@@ -1,17 +1,11 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
|
-
require "rake-version"
|
4
3
|
require "yard"
|
5
4
|
|
6
5
|
RSpec::Core::RakeTask.new(:spec)
|
7
6
|
|
8
7
|
task default: :spec
|
9
8
|
|
10
|
-
RakeVersion::Tasks.new do |v|
|
11
|
-
v.copy "lib/tabulo/version.rb"
|
12
|
-
v.copy "README.md", all: true
|
13
|
-
end
|
14
|
-
|
15
9
|
YARD::Rake::YardocTask.new do |t|
|
16
10
|
t.options = ["--markup-provider=redcarpet", "--markup=markdown"]
|
17
11
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.1
|
data/lib/tabulo/column.rb
CHANGED
@@ -101,13 +101,9 @@ module Tabulo
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
def padded_width
|
105
|
-
width + total_padding
|
106
|
-
end
|
104
|
+
def padded_width = width + total_padding
|
107
105
|
|
108
|
-
def total_padding
|
109
|
-
@left_padding + @right_padding
|
110
|
-
end
|
106
|
+
def total_padding = @left_padding + @right_padding
|
111
107
|
|
112
108
|
private
|
113
109
|
|
data/lib/tabulo/util.rb
CHANGED
@@ -6,24 +6,16 @@ module Tabulo
|
|
6
6
|
NEWLINE = /\r\n|\n|\r/
|
7
7
|
|
8
8
|
# @!visibility private
|
9
|
-
def self.condense_lines(lines)
|
10
|
-
join_lines(lines.reject(&:empty?))
|
11
|
-
end
|
9
|
+
def self.condense_lines(lines) = join_lines(lines.reject(&:empty?))
|
12
10
|
|
13
11
|
# @!visibility private
|
14
|
-
def self.divides?(smaller, larger)
|
15
|
-
larger % smaller == 0
|
16
|
-
end
|
12
|
+
def self.divides?(smaller, larger) = larger % smaller == 0
|
17
13
|
|
18
14
|
# @!visibility private
|
19
|
-
def self.join_lines(lines)
|
20
|
-
lines.join($/)
|
21
|
-
end
|
15
|
+
def self.join_lines(lines) = lines.join($/)
|
22
16
|
|
23
17
|
# @!visibility private
|
24
|
-
def self.max(x, y)
|
25
|
-
x > y ? x : y
|
26
|
-
end
|
18
|
+
def self.max(x, y) = x > y ? x : y
|
27
19
|
|
28
20
|
# @!visibility private
|
29
21
|
def self.slice_hash(hash, *keys)
|
data/lib/tabulo/version.rb
CHANGED
data/tabulo.gemspec
CHANGED
@@ -21,23 +21,22 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.required_ruby_version = ">=
|
24
|
+
spec.required_ruby_version = ">= 3.1.0"
|
25
25
|
|
26
26
|
spec.metadata = {
|
27
27
|
"source_code_uri" => "https://github.com/matt-harvey/tabulo",
|
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.8.
|
32
|
-
spec.add_runtime_dependency "unicode-display_width", "~> 2.
|
31
|
+
spec.add_runtime_dependency "tty-screen", "0.8.2"
|
32
|
+
spec.add_runtime_dependency "unicode-display_width", "~> 2.5"
|
33
33
|
|
34
|
-
spec.add_development_dependency "bundler"
|
35
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
34
|
+
spec.add_development_dependency "bundler", "~> 2.4"
|
35
|
+
spec.add_development_dependency "rake", "~> 13.0.6"
|
36
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"
|
40
40
|
spec.add_development_dependency "redcarpet"
|
41
41
|
spec.add_development_dependency "github-markup"
|
42
|
-
spec.add_development_dependency "rake-version", "~> 1.0"
|
43
42
|
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:
|
4
|
+
version: 3.0.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:
|
11
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-screen
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.8.
|
19
|
+
version: 0.8.2
|
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.8.
|
26
|
+
version: 0.8.2
|
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: '2.
|
33
|
+
version: '2.5'
|
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.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.4'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 13.0.6
|
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.6
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rake-version
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '1.0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '1.0'
|
167
153
|
description: Plain text table generator with a column-based API
|
168
154
|
email:
|
169
155
|
- software@matthewharvey.net
|
@@ -215,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
201
|
requirements:
|
216
202
|
- - ">="
|
217
203
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
204
|
+
version: 3.1.0
|
219
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
206
|
requirements:
|
221
207
|
- - ">="
|
222
208
|
- !ruby/object:Gem::Version
|
223
209
|
version: '0'
|
224
210
|
requirements: []
|
225
|
-
rubygems_version: 3.
|
211
|
+
rubygems_version: 3.5.3
|
226
212
|
signing_key:
|
227
213
|
specification_version: 4
|
228
214
|
summary: Terminal table generator
|