unicode-scripts 1.12.0 → 1.13.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: 408f42160ba401c0d6434f304703bea2f037ace4ba151887111003970564ea08
4
- data.tar.gz: 1392a2b3b7b4a717343334f5ac60c0cfec4b32773fddfd46c2287cdda2232279
3
+ metadata.gz: b0b88898119662f0432faae60c47e9271c09cbf0b0be6a4eef47d5b7c4d92fff
4
+ data.tar.gz: 46d74594eed212777caffe3fa29bdaaf1f04ddfb5eaaf6f18e6b761a794cb2d1
5
5
  SHA512:
6
- metadata.gz: 9dad0578c6bee57413301c74c08ec09e86b517d3c206e6671d038dfae3c2b85e624b58ee46a32cf1abf01f8f834be136e7234254e2f147f56bca15901163fe69
7
- data.tar.gz: b8f1e8895cff59f52e50d191465bc4608376ff7178b2e96c5e3f720c45abd81636f7c7cac386a3492ad36c8b72e4cd69cff193d02050e123dba7222ce0480507
6
+ metadata.gz: 777938842e782d0fe2d4ae853e2d8311c65d2bfd2ab62bfed02bc0d43921ad01f1dfe349c56d02e83e7c496bc71c8278c462d0474baf233bffa54ecbd99aedaa
7
+ data.tar.gz: 4da9b319921f9146dd33080642ca34099af995da26b08546de360ef213cd90f16a2e2d045269d0478c641bf5f87f1dd34c629b6fea283923caa93d60bf43d99b
data/.rake_tasks ADDED
@@ -0,0 +1,3 @@
1
+ gem
2
+ irb
3
+ spec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.13.0
4
+
5
+ - Unicode 18.0
6
+ - Adapt augmented script set (and therefor mixed/single script detection) to Unicode 18 (-> add Hntl)
7
+
3
8
  ### 1.12.0
4
9
 
5
10
  - Unicode 17.0
data/Gemfile CHANGED
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'minitest'
6
+ gem 'minitest-mock'
6
7
  gem 'rake'
7
- gem 'irb' unless RUBY_ENGINE == "jruby"
8
+ gem 'irb'
data/Gemfile.lock CHANGED
@@ -1,24 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unicode-scripts (1.12.0)
4
+ unicode-scripts (1.13.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- io-console (0.6.0)
10
- irb (1.8.1)
11
- rdoc
12
- reline (>= 0.3.8)
13
- minitest (5.20.0)
14
- psych (5.1.0)
15
- stringio
16
- rake (13.0.6)
17
- rdoc (6.5.0)
18
- psych (>= 4.0.0)
19
- reline (0.3.8)
9
+ drb (2.2.3)
10
+ erb (6.0.7)
11
+ io-console (0.9.4)
12
+ irb (1.18.0)
13
+ pp (>= 0.6.0)
14
+ prism (>= 1.3.0)
15
+ rdoc (>= 4.0.0)
16
+ reline (>= 0.4.2)
17
+ logger (1.7.0)
18
+ minitest (6.0.6)
19
+ drb (~> 2.0)
20
+ prism (~> 1.5)
21
+ minitest-mock (5.27.0)
22
+ pp (0.6.4)
23
+ prettyprint
24
+ prettyprint (0.2.0)
25
+ prism (1.9.0)
26
+ rake (13.4.2)
27
+ rbs (4.2.0)
28
+ logger
29
+ prism (>= 1.6.0)
30
+ tsort
31
+ rdoc (8.0.0)
32
+ erb
33
+ prism (>= 1.6.0)
34
+ rbs (>= 4.0.0)
35
+ tsort
36
+ reline (0.7.0)
20
37
  io-console (~> 0.5)
21
- stringio (3.0.8)
38
+ tsort (0.2.0)
22
39
 
23
40
  PLATFORMS
24
41
  ruby
@@ -26,6 +43,7 @@ PLATFORMS
26
43
  DEPENDENCIES
27
44
  irb
28
45
  minitest
46
+ minitest-mock
29
47
  rake
30
48
  unicode-scripts!
31
49
 
data/MIT-LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2025 Jan Lelis, https://janlelis.com
1
+ Copyright (c) 2016-2026 Jan Lelis, https://janlelis.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -4,9 +4,7 @@ Retrieve all [Unicode script(s)](https://en.wikipedia.org/wiki/Script_%28Unicode
4
4
 
5
5
  Based on the *Script_Extension*, this library can also return the [augmented script set](https://www.unicode.org/reports/tr39/#def-augmented-script-set) to figure out if a string is **mixed-script** or **single-script**. Mixed scripts can be an indicator of suspicious user inputs.
6
6
 
7
- Unicode version: **17.0.0** (September 2025)
8
-
9
- Supported Rubies: **3.x** (might work: **2.x**)
7
+ Unicode version: **18.0.0** (September 2026)
10
8
 
11
9
  ## Gemfile
12
10
 
@@ -128,5 +126,5 @@ See [Idiosyncratic Ruby: Proper Unicoding](https://idiosyncratic-ruby.com/41-pro
128
126
 
129
127
  ## MIT License
130
128
 
131
- - Copyright (C) 2016-2025 Jan Lelis <https://janlelis.com>. Released under the MIT license.
129
+ - Copyright (C) 2016-2026 Jan Lelis <https://janlelis.com>. Released under the MIT license.
132
130
  - Unicode data: https://www.unicode.org/copyright.html#Exhibit1
Binary file
@@ -2,11 +2,11 @@
2
2
 
3
3
  module Unicode
4
4
  module Scripts
5
- VERSION = "1.12.0"
6
- UNICODE_VERSION = "17.0.0"
5
+ VERSION = "1.13.0"
6
+ UNICODE_VERSION = "18.0.0"
7
7
  DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
8
8
  INDEX_FILENAME = (DATA_DIRECTORY + "/scripts.marshal.gz").freeze
9
9
 
10
- AUGMENTED_SCRIPT_CODES = ["Hanb", "Jpan", "Kore"]
10
+ AUGMENTED_SCRIPT_CODES = ["Hanb", "Hntl", "Jpan", "Kore"].freeze
11
11
  end
12
12
  end
@@ -62,7 +62,7 @@ module Unicode
62
62
  }
63
63
 
64
64
  if augmented.include? "Hani"
65
- augmented |= ["Hanb", "Jpan", "Kore"]
65
+ augmented |= Unicode::Scripts::AUGMENTED_SCRIPT_CODES
66
66
  end
67
67
  if augmented.include?("Hira") || augmented.include?("Kana")
68
68
  augmented |= ["Jpan"]
@@ -73,6 +73,9 @@ module Unicode
73
73
  if augmented.include? "Bopo"
74
74
  augmented |= ["Hanb"]
75
75
  end
76
+ if augmented.include? "Latn"
77
+ augmented |= ["Hntl"]
78
+ end
76
79
  if augmented.include?("Zyyy") || augmented.include?("Zinh")
77
80
  augmented |= names(format: :short, augmented: :include )
78
81
  end
@@ -1,4 +1,5 @@
1
1
  require_relative "../lib/unicode/scripts"
2
+ require "minitest/mock"
2
3
  require "minitest/autorun"
3
4
 
4
5
  describe Unicode::Scripts do
@@ -138,7 +139,15 @@ describe Unicode::Scripts do
138
139
  it "will return all extended scripts that characters in the string belong to + augmented" do
139
140
  assert_equal ["Hira", "Jpan", "Kana"], Unicode::Scripts.augmented_scripts("ねガ")
140
141
  end
141
-
142
+
143
+ it "add all Unicode::Scripts::AUGMENTED_SCRIPT_CODES for Han characters" do
144
+ assert_equal ["Hanb", "Hani", "Hntl", "Jpan", "Kore"], Unicode::Scripts.augmented_scripts("⺀")
145
+ end
146
+
147
+ it "add Hntl for Latin characters" do
148
+ assert_equal ["Hntl", "Latn"], Unicode::Scripts.augmented_scripts("A")
149
+ end
150
+
142
151
  it "will replace Common with all scripts" do
143
152
  assert_equal \
144
153
  Unicode::Scripts.names(format: :short, augmented: :include),
@@ -183,11 +192,15 @@ describe Unicode::Scripts do
183
192
  end
184
193
 
185
194
  it "will return a list of all augmented script codes" do
186
- assert_equal Unicode::Scripts.names(format: :short, augmented: :only), ["Hanb", "Jpan", "Kore"]
195
+ assert_equal Unicode::Scripts.names(format: :short, augmented: :only), ["Hanb", "Hntl", "Jpan", "Kore"]
187
196
  end
188
197
  end
189
198
 
190
199
  describe '[unicode versions]' do
200
+ it "works for scripts introduced in Unicode 18" do
201
+ assert_equal "Jurchen", Unicode::Scripts.script("\u{18E20}")
202
+ end
203
+
191
204
  it "works for scripts introduced in Unicode 17" do
192
205
  assert_equal "Tai_Yo", Unicode::Scripts.script("𞛀")
193
206
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-09-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description: "[Unicode 17.0.0] Retrieve the Unicode script(s) a string belongs to.
12
+ description: "[Unicode 18.0.0] Retrieve the Unicode script(s) a string belongs to.
14
13
  Can also return the Script_Extension property which is defined as characters which
15
14
  are 'commonly used with more than one script, but with a limited number of scripts'. "
16
15
  email:
@@ -20,6 +19,7 @@ extensions: []
20
19
  extra_rdoc_files: []
21
20
  files:
22
21
  - ".gitignore"
22
+ - ".rake_tasks"
23
23
  - CHANGELOG.md
24
24
  - CODE_OF_CONDUCT.md
25
25
  - Gemfile
@@ -39,7 +39,6 @@ licenses:
39
39
  - MIT
40
40
  metadata:
41
41
  rubygems_mfa_required: 'true'
42
- post_install_message:
43
42
  rdoc_options: []
44
43
  require_paths:
45
44
  - lib
@@ -54,8 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
53
  - !ruby/object:Gem::Version
55
54
  version: '0'
56
55
  requirements: []
57
- rubygems_version: 3.5.21
58
- signing_key:
56
+ rubygems_version: 4.0.20
59
57
  specification_version: 4
60
58
  summary: Which script(s) does a Unicode string belong to?
61
59
  test_files: