unicode-display_width 3.1.4 → 3.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9dadf5b8337ac74b8e5af2a6cd481708c39050506440ccf5d30c6cdc9eb5ade3
4
- data.tar.gz: ae3bb12a0fabe7a53a1b533909f42a86f1fc7acecc33c9b57218ed3607f71d3c
3
+ metadata.gz: b74011f05c3a5888834037aa487904d2515cddd224c9e704a00a797b84cbede0
4
+ data.tar.gz: 8e86c213031df728e95b7b2341a77b568b1876baec2d750e6832e108dfede578
5
5
  SHA512:
6
- metadata.gz: 414227480c3ae2ca0afcee225bb68b6506ac2f7dac630422db87c0a6d28d9d921bcc4645146ffa0a75ace5eb338dc71df2f051aeb0732824dbf1c7bb3117ba22
7
- data.tar.gz: 1002b3752d47df6f3d416d378148af38ff7c92698a118aded36f55e3b6bbdc99a29552fdee792636d5edea1ce2104266b1dcf9198631a7669334a48fa425af29
6
+ metadata.gz: 3cf9ec0dce0f94bbfaa44ffe75bc1caf51b74598437226dba6a253419a5397bd678bf1a7e9587603de2b9923970471b35d89bf7b218a891f46b0c396849fcc4b
7
+ data.tar.gz: 5e5cee4b27b34d5c1b9cf74f4764b3afcf1c402230a268a9b348b84e47d225253acee2680ccb9778fedf2049944f61fbeb758bc7150f8e60c23c122308cd2540
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.2.0
4
+
5
+ - Unicode 17.0
6
+
7
+ ## 3.1.5
8
+
9
+ - Cache Emoji support level for performance reasons #30, patch by @Earlopain:
10
+
3
11
  ## 3.1.4
4
12
 
5
13
  - Fix that skin tone modifiers were ignored when used in a non-ZWJ sequence
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Unicode::DisplayWidth [![[version]](https://badge.fury.io/rb/unicode-display_width.svg)](https://badge.fury.io/rb/unicode-display_width) [<img src="https://github.com/janlelis/unicode-display_width/workflows/Test/badge.svg" />](https://github.com/janlelis/unicode-display_width/actions?query=workflow%3ATest)
2
2
 
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.
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: **16.0.0** (September 2024)
5
+ Unicode version: **17.0.0** (September 2025)
6
6
 
7
7
  ## Gem Version 3 — Improved Emoji Support
8
8
 
@@ -108,8 +108,8 @@ Emoji Type | Width / Comment
108
108
  Basic/Single Emoji character without Variation Selector | No special handling
109
109
  Basic/Single Emoji character with VS15 (Text) | No special handling
110
110
  Basic/Single Emoji character with VS16 (Emoji) | 2 or East Asian Width (see table below)
111
- Single Emoji character with Skin Tone Modifier | 2
112
- Skin Tone Modifier used in isolation or with invalid base | 2 if Emoji mode is configured to `:rgi` / `:rgi_at`
111
+ Single Emoji character with Skin Tone Modifier | 2 unless Emoji mode is `:none` or `vs16`
112
+ Skin Tone Modifier used in isolation or with invalid base | 2 if Emoji mode is `:rgi` / `:rgi_at`
113
113
  Emoji Sequence | 2 if Emoji belongs to configured Emoji set (see table below)
114
114
 
115
115
  #### Emoji Modes
@@ -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-2024 Jan Lelis, https://janlelis.com, released under the MIT
191
+ - Copyright (c) 2011, 2015-2025 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.1.4"
6
- UNICODE_VERSION = "16.0.0"
5
+ VERSION = "3.2.0"
6
+ UNICODE_VERSION = "17.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
@@ -1,5 +1,4 @@
1
- # require "rbconfig"
2
- # RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ # windows
1
+ # frozen_string_literal: true
3
2
 
4
3
  module Unicode
5
4
  class DisplayWidth
@@ -13,6 +12,10 @@ module Unicode
13
12
  # Please note: Many terminals do not set any ENV vars,
14
13
  # maybe CSI queries can help?
15
14
  def self.recommended
15
+ @recommended ||= _recommended
16
+ end
17
+
18
+ def self._recommended
16
19
  if ENV["CI"]
17
20
  return :rqi
18
21
  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: 3.1.4
4
+ version: 3.2.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: 2025-01-13 00:00:00.000000000 Z
11
+ date: 2025-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unicode-emoji
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 4.0.4
19
+ version: '4.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '4.0'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 4.0.4
26
+ version: '4.1'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: rspec
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,7 +52,7 @@ dependencies:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
54
  version: '13.0'
61
- description: "[Unicode 16.0.0] Determines the monospace display width of a string
55
+ description: "[Unicode 17.0.0] Determines the monospace display width of a string
62
56
  using EastAsianWidth.txt, Unicode general category, Emoji specification, and other
63
57
  data."
64
58
  email: