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 +5 -5
- data/Gemfile.lock +8 -7
- data/lib/tabularize.rb +2 -2
- data/lib/tabularize/version.rb +1 -1
- data/tabularize.gemspec +2 -1
- data/test/test_tabularize.rb +1 -1
- metadata +22 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b74dc849febd7f37efc2f8123dff4bdc6c484df88235e0d36f886ad879173703
|
4
|
+
data.tar.gz: 81e92767c11e10162510374afca7b09d6305b8cce1d6e67bd86b535138b4b4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
5
|
-
unicode-display_width (>=
|
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.
|
11
|
-
|
10
|
+
minitest (5.14.4)
|
11
|
+
rake (13.0.6)
|
12
|
+
unicode-display_width (2.0.0)
|
12
13
|
|
13
14
|
PLATFORMS
|
14
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
data/lib/tabularize/version.rb
CHANGED
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.
|
23
|
+
s.add_development_dependency 'rake'
|
24
|
+
s.add_runtime_dependency 'unicode-display_width', '>= 2.0.0'
|
24
25
|
end
|
data/test/test_tabularize.rb
CHANGED
@@ -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
|
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.
|
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:
|
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:
|
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:
|
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
|
-
|
83
|
-
|
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:
|