unicode-display_width 3.1.5 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +2 -2
- data/data/display_width.marshal.gz +0 -0
- data/lib/unicode/display_width/constants.rb +2 -2
- data/lib/unicode/display_width/emoji_support.rb +1 -1
- data/lib/unicode/display_width.rb +4 -4
- metadata +8 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 345a2b006bdd1a963bb87ac154e3da3c233477601fb34888d28d2328ef123e61
|
|
4
|
+
data.tar.gz: 9767f986e792a1edffce1c2732da3d197a70a5acdedc27dcd1258651af797e29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffd9b9ade61e693a9438fb06e94e11f523dfe597d31284d7cd112e5354794c9df7be5603585aaeadecd74a34427473a080aae0a0f3e686624ae0678880d9f72b
|
|
7
|
+
data.tar.gz: b1299f62bf1bc55312cadeb27c26724eddd002063ca5519c650e55258a578860d561eca19bdf8b5cff9fcd84b3864d5137ad95f018efa90f765b8b8b52dfae0d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
- Unicode 18.0
|
|
6
|
+
- Fix bug that emoji handling could not be deactivated when using config object
|
|
7
|
+
- Fix edge case to not modify string when failing parsing binary input as UTF-8
|
|
8
|
+
|
|
9
|
+
## 3.2.0
|
|
10
|
+
|
|
11
|
+
- Unicode 17.0
|
|
12
|
+
|
|
3
13
|
## 3.1.5
|
|
4
14
|
|
|
5
15
|
- Cache Emoji support level for performance reasons #30, patch by @Earlopain:
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Determines the monospace display width of a string in Ruby, which is useful for all kinds of terminal-based applications. The implementation is based on [EastAsianWidth.txt](https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt), the [Emoji specfication](https://www.unicode.org/reports/tr51/) and other data, 100% in Ruby. It does not rely on the OS vendor ([wcwidth](https://github.com/janlelis/wcswidth-ruby)) to provide an up-to-date method for measuring string width in terminals.
|
|
4
4
|
|
|
5
|
-
Unicode version: **
|
|
5
|
+
Unicode version: **18.0.0** (September 2026)
|
|
6
6
|
|
|
7
7
|
## Gem Version 3 — Improved Emoji Support
|
|
8
8
|
|
|
@@ -188,7 +188,7 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
|
188
188
|
|
|
189
189
|
## Copyright & Info
|
|
190
190
|
|
|
191
|
-
- Copyright (c) 2011, 2015-
|
|
191
|
+
- Copyright (c) 2011, 2015-2026 Jan Lelis, https://janlelis.com, released under the MIT
|
|
192
192
|
license
|
|
193
193
|
- Early versions based on runpaint's unicode-data interface: Copyright (c) 2009 Run Paint Run Run
|
|
194
194
|
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
|
Binary file
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Unicode
|
|
4
4
|
class DisplayWidth
|
|
5
|
-
VERSION = "3.
|
|
6
|
-
UNICODE_VERSION = "
|
|
5
|
+
VERSION = "3.3.0"
|
|
6
|
+
UNICODE_VERSION = "18.0.0"
|
|
7
7
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/")
|
|
8
8
|
INDEX_FILENAME = DATA_DIRECTORY + "/display_width.marshal.gz"
|
|
9
9
|
end
|
|
@@ -51,9 +51,9 @@ module Unicode
|
|
|
51
51
|
def self.of(string, ambiguous = nil, overwrite = nil, old_options = {}, **options)
|
|
52
52
|
# Binary strings don't make much sense when calculating display width.
|
|
53
53
|
# Assume it's valid UTF-8
|
|
54
|
-
if string.encoding == Encoding::BINARY
|
|
55
|
-
|
|
56
|
-
string.
|
|
54
|
+
if string.encoding == Encoding::BINARY
|
|
55
|
+
utf8_string = string.dup.force_encoding(Encoding::UTF_8)
|
|
56
|
+
string = utf8_string if utf8_string.valid_encoding?
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
string = string.encode(Encoding::UTF_8, invalid: :replace, undef: :replace) unless string.encoding == Encoding::UTF_8
|
|
@@ -236,7 +236,7 @@ module Unicode
|
|
|
236
236
|
{
|
|
237
237
|
ambiguous: kwargs[:ambiguous] || @ambiguous,
|
|
238
238
|
overwrite: kwargs[:overwrite] || @overwrite,
|
|
239
|
-
emoji: kwargs
|
|
239
|
+
emoji: kwargs.fetch(:emoji, @emoji),
|
|
240
240
|
}
|
|
241
241
|
end
|
|
242
242
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unicode-display_width
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Lelis
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: unicode-emoji
|
|
@@ -16,20 +15,14 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '4.
|
|
20
|
-
- - ">="
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: 4.0.4
|
|
18
|
+
version: '4.3'
|
|
23
19
|
type: :runtime
|
|
24
20
|
prerelease: false
|
|
25
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
22
|
requirements:
|
|
27
23
|
- - "~>"
|
|
28
24
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '4.
|
|
30
|
-
- - ">="
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: 4.0.4
|
|
25
|
+
version: '4.3'
|
|
33
26
|
- !ruby/object:Gem::Dependency
|
|
34
27
|
name: rspec
|
|
35
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -58,7 +51,7 @@ dependencies:
|
|
|
58
51
|
- - "~>"
|
|
59
52
|
- !ruby/object:Gem::Version
|
|
60
53
|
version: '13.0'
|
|
61
|
-
description: "[Unicode
|
|
54
|
+
description: "[Unicode 18.0.0] Determines the monospace display width of a string
|
|
62
55
|
using EastAsianWidth.txt, Unicode general category, Emoji specification, and other
|
|
63
56
|
data."
|
|
64
57
|
email:
|
|
@@ -66,9 +59,9 @@ email:
|
|
|
66
59
|
executables: []
|
|
67
60
|
extensions: []
|
|
68
61
|
extra_rdoc_files:
|
|
69
|
-
- README.md
|
|
70
|
-
- MIT-LICENSE.txt
|
|
71
62
|
- CHANGELOG.md
|
|
63
|
+
- MIT-LICENSE.txt
|
|
64
|
+
- README.md
|
|
72
65
|
files:
|
|
73
66
|
- CHANGELOG.md
|
|
74
67
|
- MIT-LICENSE.txt
|
|
@@ -89,7 +82,6 @@ metadata:
|
|
|
89
82
|
source_code_uri: https://github.com/janlelis/unicode-display_width
|
|
90
83
|
bug_tracker_uri: https://github.com/janlelis/unicode-display_width/issues
|
|
91
84
|
rubygems_mfa_required: 'true'
|
|
92
|
-
post_install_message:
|
|
93
85
|
rdoc_options: []
|
|
94
86
|
require_paths:
|
|
95
87
|
- lib
|
|
@@ -104,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
104
96
|
- !ruby/object:Gem::Version
|
|
105
97
|
version: '0'
|
|
106
98
|
requirements: []
|
|
107
|
-
rubygems_version:
|
|
108
|
-
signing_key:
|
|
99
|
+
rubygems_version: 4.0.20
|
|
109
100
|
specification_version: 4
|
|
110
101
|
summary: Determines the monospace display width of a string in Ruby.
|
|
111
102
|
test_files: []
|