tabulo 2.8.1 → 3.0.0

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: '0967716cb8ae0364c51187023e9515933615d25de080d95b08c931cbf17a11a0'
4
- data.tar.gz: e6497d0121eefcb8960370a5ee9d3884143b89a0a45336aaa30814095be3794d
3
+ metadata.gz: 1caf6afe39dac10310acb889d870d0c2f0745d9a27a1ef7e94b84c92f1b92320
4
+ data.tar.gz: 311f5d138f57f19575f481c7ed504e5cd85f3251dea72cec88eb1eca25ec5d9e
5
5
  SHA512:
6
- metadata.gz: 9d49aeccc15b496344ae03b93ca10cce1b3c02d706f43e68f30285f7c0bf9c6a81bbcbec68768791b5cb37b0f75dcec33ce45999e87b33ee39a01eb8997217ca
7
- data.tar.gz: 846cfe4796836b485848b6f9fdcd1b1e8f0907587b5c32debb50734ded99e6992e56a4b62d6d755740e03d5831182fb4e7f0c9fe67e04bad636baac2cc090deb
6
+ metadata.gz: e0e18c606c1577357d843a8e3b10430b96f9051e2870f4a151ebdb5a11e2d6cf15a593f5b1399cc4615bc61251226eb0247d26c7f44802fe181e2802dbeed57a
7
+ data.tar.gz: 543ec526d1d26e91deb7ef74b895927f32df83f6d80683216144538bdd6ff9242b5d3cec1f66ce2445713926c2e75530c48c8ab6e79e57ea5230ce09a92d96c6
@@ -19,23 +19,18 @@ jobs:
19
19
  strategy:
20
20
  matrix:
21
21
  ruby-version: [
22
- '2.2.10',
23
- '2.3.8',
24
- '2.4.10',
25
- '2.5.9',
26
- '2.6.10',
27
- '2.7.6',
28
- '3.0.4',
29
- '3.1.2',
22
+ '3.1.4',
23
+ '3.2.2',
30
24
  ]
31
25
  steps:
32
- - uses: actions/checkout@v2
26
+ - uses: actions/checkout@v3
33
27
  - name: Set up Ruby
34
28
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
35
29
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
36
30
  uses: ruby/setup-ruby@v1 # Was: uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
37
31
  with:
38
32
  ruby-version: ${{ matrix.ruby-version }}
33
+ bundler: 2.4.14
39
34
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
40
35
  - name: Run tests
41
36
  run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,9 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ### v3.0.0
4
+
5
+ * Require Ruby >= 3.1
6
+ * Upgrade dependency versions
7
+ * Remove "rake-version" development dependency; it's not essential, and doesn't
8
+ currently work with Ruby 3.2.
9
+
10
+ ### v2.8.2
11
+
12
+ * Relax dependencies to address incompatibility with recent Rubocop version.
13
+ Thanks to Fabrizio Monti ([@delphaber](https://github.com/delphaber)) for this fix:
14
+ https://github.com/matt-harvey/tabulo/pull/23.
15
+ * Add CI coverage for Ruby 3.2
16
+ * Upgrade dependency versions in Github action to address deprecation warnings
17
+
18
+ ### v2.8.1
19
+
20
+ * Upgrade dependency versions
21
+ * Minor documentation fixes
22
+
3
23
  ### v2.8.0
4
24
 
5
25
  * Add `except:` param to `Tabulo::Table#pack` method, allowing specific
6
- columns to be excluded from the action of `.pack`
26
+ columns to be excluded from the action of `.pack`.
27
+ Thanks to Janosch Müller ([@jaynetics](https://github.com/jaynetics)) for this feature:
28
+ https://github.com/matt-harvey/tabulo/pull/21.
7
29
  * Provide method `Tabulo::Table#autosize_columns`, allowing columns to be auto-sized
8
30
  to fit their contents' widths, without having to call `.pack` (which also has
9
31
  other effects on the table). This method also has an `except:` param allowing columns
@@ -15,7 +37,9 @@
15
37
  * Fix `max_table_width:` param to `.pack` not being respected if table title was
16
38
  wider than terminal.
17
39
  * Documentation improvements
18
- * Fix broken documentation links
40
+ * Fix broken documentation links.
41
+ Thanks to Janosch Müller ([@jaynetics](https://github.com/jaynetics)):
42
+ https://github.com/matt-harvey/tabulo/pull/19.
19
43
  * Add Ruby 3.1 to CI config
20
44
 
21
45
  ### v2.7.3
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,10 @@
1
+ # Contributors
2
+
3
+ ## Original author
4
+
5
+ * Matt Harvey ([@matt-harvey](https://github.com/matt-harvey))
6
+
7
+ ## Contributors
8
+
9
+ * Janosch Müller ([@jaynetics](https://github.com/jaynetics))
10
+ * Fabrizio Monti ([@delphaber](https://github.com/delphaber))
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/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.
547
+ for the [`#autosize_columns`](https://www.rubydoc.info/gems/tabulo/3.0.0/Tabulo/Table#autosize_columns-instance_method)
548
+ and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/3.0.0/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/2.8.1/Tabulo/CellData.html)
813
+ it—see the [documentation](https://www.rubydoc.info/gems/tabulo/3.0.0/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/2.8.1/Tabulo/Table#add_column-instance_method) for details.
859
+ [documentation](https://www.rubydoc.info/gems/tabulo/3.0.0/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/2.8.1/Tabulo/Table#add_column-instance_method)
879
+ [documentation](https://www.rubydoc.info/gems/tabulo/3.0.0/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/2.8.1/Tabulo/Table#initialize-instance_method)
893
+ [documentation](https://www.rubydoc.info/gems/tabulo/3.0.0/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`&#8217;s behaviour. For details, see the
1094
- [documentation](https://www.rubydoc.info/gems/tabulo/2.8.1/Tabulo/Table#transpose-instance_method).
1094
+ [documentation](https://www.rubydoc.info/gems/tabulo/3.0.0/Tabulo/Table#transpose-instance_method).
1095
1095
 
1096
1096
  <a name="borders"></a>
1097
1097
  ### Configuring borders [&#x2191;](#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-v2.8.1-blue.svg
1497
+ [DC img]: https://img.shields.io/badge/documentation-v3.0.0-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
- 2.8.1
1
+ 3.0.0
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)
@@ -1,3 +1,3 @@
1
1
  module Tabulo
2
- VERSION = "2.8.1"
2
+ VERSION = "3.0.0"
3
3
  end
data/tabulo.gemspec CHANGED
@@ -21,7 +21,7 @@ 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 = ">= 2.1.10"
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",
@@ -29,15 +29,14 @@ 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.2.0"
32
+ spec.add_runtime_dependency "unicode-display_width", "~> 2.2"
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: 2.8.1
4
+ version: 3.0.0
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-07-27 00:00:00.000000000 Z
11
+ date: 2023-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-screen
@@ -28,44 +28,44 @@ dependencies:
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.2.0
33
+ version: '2.2'
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.2.0
40
+ version: '2.2'
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: '0'
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: '0'
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: '13.0'
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: '13.0'
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
@@ -179,6 +165,7 @@ files:
179
165
  - ".simplecov"
180
166
  - ".yardopts"
181
167
  - CHANGELOG.md
168
+ - CONTRIBUTORS.md
182
169
  - Gemfile
183
170
  - LICENSE.txt
184
171
  - README.md
@@ -214,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
201
  requirements:
215
202
  - - ">="
216
203
  - !ruby/object:Gem::Version
217
- version: 2.1.10
204
+ version: 3.1.0
218
205
  required_rubygems_version: !ruby/object:Gem::Requirement
219
206
  requirements:
220
207
  - - ">="
221
208
  - !ruby/object:Gem::Version
222
209
  version: '0'
223
210
  requirements: []
224
- rubygems_version: 3.2.3
211
+ rubygems_version: 3.4.10
225
212
  signing_key:
226
213
  specification_version: 4
227
214
  summary: Terminal table generator