tabularize 0.2.10 → 0.3.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
- SHA1:
3
- metadata.gz: 7ebddef4476bce7d4f6b75b1891f77daaab34946
4
- data.tar.gz: be1529b7c1ecc2337a793347ff290e4762e97ac3
2
+ SHA256:
3
+ metadata.gz: b74dc849febd7f37efc2f8123dff4bdc6c484df88235e0d36f886ad879173703
4
+ data.tar.gz: 81e92767c11e10162510374afca7b09d6305b8cce1d6e67bd86b535138b4b4a1
5
5
  SHA512:
6
- metadata.gz: 409584234c499bcb0f468ac3572c9053c0ea9657dd29382bc3136d0e3c2d85fe818e9712c24542dabdf2a9b6abd543445728a26e3412a6e7a6064e98a1258175
7
- data.tar.gz: 0bd6a9731f4b23af63b873591869b8dbf9626a6fa50783c95127edcbb305de085826f724bf20ca74536cf2238384e0a788c8ddb33ea9cec0210653079bc7261c
6
+ metadata.gz: fd686051d7803dbae825bd1172fd1e8e67ba3bc19f0d162ce1b7cff550c981f58fb072aa24fe2595a62c409e72a0db272407385249cf8b0ac7ad56d0fff50fab
7
+ data.tar.gz: 58c62bb1919eade8506fad4e666edfdf7cb09e81b7870577edc3b0f790091f3db00b8779b2b04881603cf0a1e61b7c197e77155d7ec9a1a7e96f0cb1a5a49e77
data/Gemfile.lock CHANGED
@@ -1,22 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tabularize (0.2.10)
5
- unicode-display_width (>= 1.3.0)
4
+ tabularize (0.3.0)
5
+ unicode-display_width (>= 2.0.0)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- minitest (5.10.3)
11
- unicode-display_width (1.3.0)
10
+ minitest (5.14.4)
11
+ rake (13.0.6)
12
+ unicode-display_width (2.0.0)
12
13
 
13
14
  PLATFORMS
14
- java
15
- ruby
15
+ x86_64-darwin-20
16
16
 
17
17
  DEPENDENCIES
18
18
  minitest
19
+ rake
19
20
  tabularize!
20
21
 
21
22
  BUNDLED WITH
22
- 1.15.4
23
+ 2.2.25
data/lib/tabularize.rb CHANGED
@@ -192,7 +192,7 @@ class Tabularize
192
192
  # @since 0.2.0
193
193
  def self.cell_width(str, unicode, ansi)
194
194
  str = str.gsub(/\e\[\d*(?:;\d+)*m/, '') if ansi
195
- str.send(unicode ? :display_width : :length)
195
+ unicode ? Unicode::DisplayWidth.of(str) : str.length
196
196
  end
197
197
 
198
198
  # Determines maximum widths of cells and maximum heights of rows
@@ -305,7 +305,7 @@ class Tabularize
305
305
  slen = str.length - alen
306
306
 
307
307
  w = max_widths[idx]
308
- w += str.length - str.display_width if unicode
308
+ w += str.length - Unicode::DisplayWidth.of(str) if unicode
309
309
  pad * padl +
310
310
  case align[idx] || align.last
311
311
  when :left
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tabularize
4
- VERSION = '0.2.10'
4
+ VERSION = '0.3.0'
5
5
  end
data/tabularize.gemspec CHANGED
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # specify any dependencies here; for example:
22
22
  s.add_development_dependency 'minitest'
23
- s.add_runtime_dependency 'unicode-display_width', '>= 1.3.0'
23
+ s.add_development_dependency 'rake'
24
+ s.add_runtime_dependency 'unicode-display_width', '>= 2.0.0'
24
25
  end
@@ -298,7 +298,7 @@ class TestTabularize < Minitest::Test
298
298
  border_style: :unicode, unicode: false, screen_width: 200
299
299
  )
300
300
  table << %w[abcde] * 100
301
- assert table.to_s.lines.first.display_width > 190
301
+ assert Unicode::DisplayWidth.of(table.to_s.lines.first) > 190
302
302
  end
303
303
 
304
304
  def test_it_nil_column
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabularize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Junegunn Choi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-12 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: unicode-display_width
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: 1.3.0
47
+ version: 2.0.0
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: 1.3.0
54
+ version: 2.0.0
41
55
  description: Formatting tabular data with paddings and alignments
42
56
  email:
43
57
  - junegunn.c@gmail.com
@@ -64,7 +78,7 @@ files:
64
78
  homepage: https://github.com/junegunn/tabularize
65
79
  licenses: []
66
80
  metadata: {}
67
- post_install_message:
81
+ post_install_message:
68
82
  rdoc_options: []
69
83
  require_paths:
70
84
  - lib
@@ -79,9 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
93
  - !ruby/object:Gem::Version
80
94
  version: '0'
81
95
  requirements: []
82
- rubyforge_project: tabularize
83
- rubygems_version: 2.6.11
84
- signing_key:
96
+ rubygems_version: 3.2.15
97
+ signing_key:
85
98
  specification_version: 4
86
99
  summary: Formatting tabular data
87
100
  test_files: