table_format 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/0170_emoji.rb +7 -0
- data/lib/table_format/generator.rb +10 -1
- data/lib/table_format/version.rb +1 -1
- data/spec/table_format_spec.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc7a2457aeea59874ff842029a0ddb07612b2ea9d4b933c758ad65ee5e6898cf
|
4
|
+
data.tar.gz: 3cd187d8d8b08a9a1be678a1cb0c00f4f1fca434655037cbd4a1c354af790e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b73b71faba2c2ab0725d46dcfc7a1a199d4c88d5ed400332334e53bf0dd89f9862426fbbba631703ca3ba29006b76c129ada2352b6f032559af1fdcc640151d1
|
7
|
+
data.tar.gz: cdfc9c695aa40bdeadba4fb29674fd3c5f3fc9d3ddc41c22462d738b15eac59b0cd1f3e3c41ec37818df6d3ce453929cd1c13eecbf4d1c17f31037156c450a1b
|
@@ -154,7 +154,16 @@ module TableFormat
|
|
154
154
|
end
|
155
155
|
|
156
156
|
def str_width(str)
|
157
|
-
str.to_s
|
157
|
+
s = str.to_s
|
158
|
+
x = nil
|
159
|
+
if @options[:in_code] == Kconv::UTF8
|
160
|
+
begin
|
161
|
+
x = s.encode("EUC-JP", "UTF-8", invalid: :replace, undef: :replace, replace: "xx")
|
162
|
+
rescue EncodingError
|
163
|
+
end
|
164
|
+
end
|
165
|
+
x ||= s.kconv(Kconv::EUC, @options[:in_code])
|
166
|
+
x.bytesize
|
158
167
|
end
|
159
168
|
|
160
169
|
def pre_processes
|
data/lib/table_format/version.rb
CHANGED
data/spec/table_format_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akicho8
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- examples/0140_markdown_format.rb
|
113
113
|
- examples/0150_line_break.rb
|
114
114
|
- examples/0160_truncate.rb
|
115
|
+
- examples/0170_emoji.rb
|
115
116
|
- lib/table_format.rb
|
116
117
|
- lib/table_format/core_ext.rb
|
117
118
|
- lib/table_format/generator.rb
|