unicode-display_width 1.4.1 → 1.5.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 +4 -0
- data/MIT-LICENSE.txt +1 -1
- data/README.md +10 -10
- data/data/display_width.marshal.gz +0 -0
- data/lib/unicode/display_width/constants.rb +2 -2
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6da19ce5cab748ae567235ad91d8e5c9526215e801b399691dfadc42ac794433
|
4
|
+
data.tar.gz: 343aa9608ff36d4b651b671936ba1ca024f6611ec7fc4aa39e2c3af625801c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2807cafb6f6e46fbf9d4d86b0f4e9d9a86b34a77d687f6fdf8284a7731000b0bcd2533eb3363b9909854d4af0f9cd1f5b9bd56b1003b83400b392e2aa777359
|
7
|
+
data.tar.gz: 10abe3e664ed62d93ca3ffe1150e3ef163a53f48d324657d5c908538324473a0a77c91003cdb4ba0e840dc7053ab4ca06ec4027aeed0badb21780ee0aeec95b8
|
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
## Unicode::DisplayWidth [![[version]](https://badge.fury.io/rb/unicode-display_width.svg)](
|
1
|
+
## Unicode::DisplayWidth [![[version]](https://badge.fury.io/rb/unicode-display_width.svg)](https://badge.fury.io/rb/unicode-display_width) [<img src="https://travis-ci.org/janlelis/unicode-display_width.png" />](https://travis-ci.org/janlelis/unicode-display_width)
|
2
2
|
|
3
|
-
Determines the monospace display width of a string in Ruby. Implementation based on [EastAsianWidth.txt](
|
3
|
+
Determines the monospace display width of a string in Ruby. Implementation based on [EastAsianWidth.txt](https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt) and other data, 100% in Ruby. Other than [wcwidth()](https://github.com/janlelis/wcswidth-ruby), which fulfills a similar purpose, it does not rely on the OS vendor to provide an up-to-date method for measuring string width.
|
4
4
|
|
5
|
-
Unicode version: **
|
5
|
+
Unicode version: **12.0.0**
|
6
6
|
|
7
|
-
Supported Rubies: **2.
|
7
|
+
Supported Rubies: **2.6**, **2.5**, **2.4**
|
8
8
|
|
9
|
-
Old Rubies that might still work: **2.2**, **2.1**, **2.0**, **1.9**
|
9
|
+
Old Rubies that might still work: **2.3**, **2.2**, **2.1**, **2.0**, **1.9**
|
10
10
|
|
11
11
|
## Introduction to Character Widths
|
12
12
|
|
13
|
-
|
13
|
+
Guessing the correct space a character will consume on terminals is not easy. There is no single standard. Most implementations combine data from [East Asian Width](https://www.unicode.org/reports/tr11/), some [General Categories](https://en.wikipedia.org/wiki/Unicode_character_property#General_Category), and hand-picked adjustments.
|
14
14
|
|
15
15
|
### How this Library Handles Widths
|
16
16
|
|
@@ -53,7 +53,7 @@ Unicode::DisplayWidth.of("一") # => 2
|
|
53
53
|
|
54
54
|
### Ambiguous Characters
|
55
55
|
|
56
|
-
The second parameter defines the value returned by
|
56
|
+
The second parameter defines the value returned by characters defined as ambiguous:
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
Unicode::DisplayWidth.of("·", 1) # => 1
|
@@ -111,14 +111,14 @@ Replace "一" with the actual string to measure
|
|
111
111
|
|
112
112
|
- Python: https://github.com/jquast/wcwidth
|
113
113
|
- JavaScript: https://github.com/mycoboco/wcwidth.js
|
114
|
-
- C:
|
114
|
+
- C: https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
|
115
115
|
- C for Julia: https://github.com/JuliaLang/utf8proc/issues/2
|
116
116
|
|
117
117
|
See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related micro libraries.
|
118
118
|
|
119
119
|
## Copyright & Info
|
120
120
|
|
121
|
-
- Copyright (c) 2011, 2015-
|
121
|
+
- Copyright (c) 2011, 2015-2019 Jan Lelis, https://janlelis.com, released under the MIT
|
122
122
|
license
|
123
123
|
- Early versions based on runpaint's unicode-data interface: Copyright (c) 2009 Run Paint Run Run
|
124
|
-
- Unicode data:
|
124
|
+
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Unicode
|
2
2
|
module DisplayWidth
|
3
|
-
VERSION = '1.
|
4
|
-
UNICODE_VERSION = "
|
3
|
+
VERSION = '1.5.0'
|
4
|
+
UNICODE_VERSION = "12.0.0".freeze
|
5
5
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
|
6
6
|
INDEX_FILENAME = (DATA_DIRECTORY + '/display_width.marshal.gz').freeze
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-display_width
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.4'
|
41
|
-
description: "[Unicode
|
41
|
+
description: "[Unicode 12.0.0] Determines the monospace display width of a string
|
42
42
|
using EastAsianWidth.txt, Unicode general category, and other data."
|
43
43
|
email: mail@janlelis.de
|
44
44
|
executables: []
|
@@ -60,7 +60,10 @@ files:
|
|
60
60
|
homepage: https://github.com/janlelis/unicode-display_width
|
61
61
|
licenses:
|
62
62
|
- MIT
|
63
|
-
metadata:
|
63
|
+
metadata:
|
64
|
+
changelog_uri: https://github.com/janlelis/unicode-display_width/blob/master/CHANGELOG.md
|
65
|
+
source_code_uri: https://github.com/janlelis/unicode-display_width
|
66
|
+
bug_tracker_uri: https://github.com/janlelis/unicode-display_width/issues
|
64
67
|
post_install_message:
|
65
68
|
rdoc_options: []
|
66
69
|
require_paths:
|
@@ -76,8 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
79
|
- !ruby/object:Gem::Version
|
77
80
|
version: '0'
|
78
81
|
requirements: []
|
79
|
-
|
80
|
-
rubygems_version: 2.7.7
|
82
|
+
rubygems_version: 3.0.1
|
81
83
|
signing_key:
|
82
84
|
specification_version: 4
|
83
85
|
summary: Determines the monospace display width of a string in Ruby.
|