unicode-scripts 1.7.0 → 1.8.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/Gemfile.lock +8 -4
- data/MIT-LICENSE.txt +1 -1
- data/README.md +7 -3
- data/data/scripts.marshal.gz +0 -0
- data/lib/unicode/scripts/constants.rb +2 -2
- data/spec/unicode_scripts_spec.rb +24 -18
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 172b5d6b3faad4610c98dffad89ecd6c4ba7a3e262f928a6311be6753956173b
|
4
|
+
data.tar.gz: adcec9d7c3d3f250a073ced02e598c98bec776e6af260717268bd87e771d6730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb57019cce6e7b1ee25c562c678803d67b3978101f9e62e5dd17f5e88a47ba453846fc54776d489dd96157c300cbf7cc2771c2a0949fb88f25c2f4d996a8b178
|
7
|
+
data.tar.gz: 07c9435f445c03944aabadbfb51d0dcff53154c173bdc312af6ac7aa7628546b475e230810ba39d088a140115aa6c9052ec868af80026e2cd6aa121db804708e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unicode-scripts (1.
|
4
|
+
unicode-scripts (1.8.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
io-console (0.5.11)
|
10
|
+
irb (1.4.1)
|
11
|
+
reline (>= 0.3.0)
|
12
|
+
minitest (5.16.3)
|
13
|
+
rake (13.0.6)
|
14
|
+
reline (0.3.1)
|
15
|
+
io-console (~> 0.5)
|
12
16
|
|
13
17
|
PLATFORMS
|
14
18
|
ruby
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Retrieve the [Unicode script(s)](https://en.wikipedia.org/wiki/Script_%28Unicode%29) a string belongs to. Can also return the *Script_Extension* property which is defined as characters which are "commonly used with more than one script, but with a limited number of scripts".
|
4
4
|
|
5
|
-
Unicode version: **
|
5
|
+
Unicode version: **15.0.0** (September 2022)
|
6
6
|
|
7
|
-
Supported Rubies: **3.0**, **2.7**
|
7
|
+
Supported Rubies: **3.1**, **3.0**, **2.7**
|
8
8
|
|
9
9
|
Old Rubies that might still work: **2.6**, **2.5**, **2.4**, **2.3**, **2.2**, **2.1**, **2.0**
|
10
10
|
|
@@ -118,6 +118,7 @@ Kaithi
|
|
118
118
|
Kannada
|
119
119
|
Katakana
|
120
120
|
Katakana_Or_Hiragana
|
121
|
+
Kawi
|
121
122
|
Kayah_Li
|
122
123
|
Kharoshthi
|
123
124
|
Khitan_Small_Script
|
@@ -152,6 +153,7 @@ Mro
|
|
152
153
|
Multani
|
153
154
|
Myanmar
|
154
155
|
Nabataean
|
156
|
+
Nag_Mundari
|
155
157
|
Nandinagari
|
156
158
|
New_Tai_Lue
|
157
159
|
Newa
|
@@ -291,6 +293,7 @@ Ital
|
|
291
293
|
Java
|
292
294
|
Kali
|
293
295
|
Kana
|
296
|
+
Kawi
|
294
297
|
Khar
|
295
298
|
Khmr
|
296
299
|
Khoj
|
@@ -323,6 +326,7 @@ Mroo
|
|
323
326
|
Mtei
|
324
327
|
Mult
|
325
328
|
Mymr
|
329
|
+
Nagm
|
326
330
|
Nand
|
327
331
|
Narb
|
328
332
|
Nbat
|
@@ -401,5 +405,5 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
401
405
|
|
402
406
|
## MIT License
|
403
407
|
|
404
|
-
- Copyright (C) 2016-
|
408
|
+
- Copyright (C) 2016-2022 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
405
409
|
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
data/data/scripts.marshal.gz
CHANGED
Binary file
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Unicode
|
4
4
|
module Scripts
|
5
|
-
VERSION = "1.
|
6
|
-
UNICODE_VERSION = "
|
5
|
+
VERSION = "1.8.0"
|
6
|
+
UNICODE_VERSION = "15.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
|
end
|
@@ -16,19 +16,21 @@ describe Unicode::Scripts do
|
|
16
16
|
assert_equal ["Cyrillic", "Latin"], Unicode::Scripts.of("AС")
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
if RUBY_ENGINE != "jruby"
|
20
|
+
it "will call .script for every character" do
|
21
|
+
mocked_method = MiniTest::Mock.new
|
22
|
+
if RUBY_VERSION >= "2.7"
|
23
|
+
mocked_method.expect :call, "first script", ["С"]
|
24
|
+
mocked_method.expect :call, "second script", ["A"]
|
25
|
+
else
|
26
|
+
mocked_method.expect :call, "first script", ["С", {}]
|
27
|
+
mocked_method.expect :call, "second script", ["A", {}]
|
28
|
+
end
|
29
|
+
Unicode::Scripts.stub :script, mocked_method do
|
30
|
+
Unicode::Scripts.of("СA")
|
31
|
+
end
|
32
|
+
mocked_method.verify
|
27
33
|
end
|
28
|
-
Unicode::Scripts.stub :script, mocked_method do
|
29
|
-
Unicode::Scripts.of("СA")
|
30
|
-
end
|
31
|
-
mocked_method.verify
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
@@ -110,13 +112,17 @@ describe Unicode::Scripts do
|
|
110
112
|
assert_equal ["Cyrillic", "Latin"], Unicode::Scripts.script_extensions("AС")
|
111
113
|
end
|
112
114
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
115
|
+
if RUBY_VERSION >= "3.0" && RUBY_ENGINE != "jruby"
|
116
|
+
it "will call .scripts for characters that have no explicit script extension" do
|
117
|
+
mocked_method = MiniTest::Mock.new
|
118
|
+
|
119
|
+
mocked_method.expect(:call, ["scripts"], ["A"], format: :long)
|
120
|
+
|
121
|
+
Unicode::Scripts.stub :scripts, mocked_method do
|
122
|
+
Unicode::Scripts.script_extensions("A")
|
123
|
+
end
|
124
|
+
mocked_method.verify
|
118
125
|
end
|
119
|
-
mocked_method.verify
|
120
126
|
end
|
121
127
|
end
|
122
128
|
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Unicode
|
14
|
-
Can also return the Script_Extension property which is defined as characters which
|
15
|
-
are 'commonly used with more than one script, but with a limited number of scripts'. "
|
13
|
+
description: "[Unicode 15.0.0] Retrieve the Unicode script(s) a string belongs to.\
|
14
|
+
\ Can also return the Script_Extension property which is defined as characters which\
|
15
|
+
\ are 'commonly used with more than one script, but with a limited number of scripts'. "
|
16
16
|
email:
|
17
17
|
- hi@ruby.consulting
|
18
18
|
executables: []
|
@@ -38,7 +38,7 @@ homepage: https://github.com/janlelis/unicode-scripts
|
|
38
38
|
licenses:
|
39
39
|
- MIT
|
40
40
|
metadata: {}
|
41
|
-
post_install_message:
|
41
|
+
post_install_message:
|
42
42
|
rdoc_options: []
|
43
43
|
require_paths:
|
44
44
|
- lib
|
@@ -53,8 +53,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
|
57
|
-
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.7.10
|
58
|
+
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: Which script(s) does a Unicode string belong to?
|
60
61
|
test_files:
|