tabulo 2.8.2 → 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: aa59f4b5fde7fbaa1f0bfdecb805a3025644c4500e3680f04ba4bbaafdc6dcc5
4
- data.tar.gz: b84f3b9a98fd95c065f850a77e7f724bf4095a715c775ec56eb54fef97e2e015
3
+ metadata.gz: 1caf6afe39dac10310acb889d870d0c2f0745d9a27a1ef7e94b84c92f1b92320
4
+ data.tar.gz: 311f5d138f57f19575f481c7ed504e5cd85f3251dea72cec88eb1eca25ec5d9e
5
5
  SHA512:
6
- metadata.gz: 1b20d2a15dd344b052b8c9448062f3e1d25bc046ab8a7eb83b7842edaa8918a47c0f7a7f49f93c1121b398fea2ce35bbcb58be3358e6610eff1d9e42724f5973
7
- data.tar.gz: 2f63da39400db49f793fa2f331afc1a86d687b34a62caba1068972533de0505e18f1c26bffb67bf87a914177a9931589cc8ee6a651eeb6974f77312bac39e824
6
+ metadata.gz: e0e18c606c1577357d843a8e3b10430b96f9051e2870f4a151ebdb5a11e2d6cf15a593f5b1399cc4615bc61251226eb0247d26c7f44802fe181e2802dbeed57a
7
+ data.tar.gz: 543ec526d1d26e91deb7ef74b895927f32df83f6d80683216144538bdd6ff9242b5d3cec1f66ce2445713926c2e75530c48c8ab6e79e57ea5230ce09a92d96c6
@@ -19,15 +19,8 @@ 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.7',
28
- '3.0.5',
29
- '3.1.3',
30
- '3.2.0',
22
+ '3.1.4',
23
+ '3.2.2',
31
24
  ]
32
25
  steps:
33
26
  - uses: actions/checkout@v3
@@ -37,6 +30,7 @@ jobs:
37
30
  uses: ruby/setup-ruby@v1 # Was: uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
38
31
  with:
39
32
  ruby-version: ${{ matrix.ruby-version }}
33
+ bundler: 2.4.14
40
34
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
41
35
  - name: Run tests
42
36
  run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ### v2.8.2
4
11
 
5
12
  * 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/2.8.2/Tabulo/Table#autosize_columns-instance_method)
548
- and [`#shrink_to`](https://www.rubydoc.info/gems/tabulo/2.8.2/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.2/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.2/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.2/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.2/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.2/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.2-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.2
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.2"
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",
@@ -31,13 +31,12 @@ Gem::Specification.new do |spec|
31
31
  spec.add_runtime_dependency "tty-screen", "0.8.1"
32
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.2
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: 2023-01-18 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
@@ -42,30 +42,30 @@ dependencies:
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
@@ -215,14 +201,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
201
  requirements:
216
202
  - - ">="
217
203
  - !ruby/object:Gem::Version
218
- version: 2.1.10
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.2.3
211
+ rubygems_version: 3.4.10
226
212
  signing_key:
227
213
  specification_version: 4
228
214
  summary: Terminal table generator