unicode-scripts 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -11
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/MIT-LICENSE.txt +1 -1
- data/README.md +13 -8
- data/data/scripts.marshal.gz +0 -0
- data/lib/unicode/scripts/constants.rb +2 -2
- data/spec/unicode_scripts_spec.rb +7 -2
- data/unicode-scripts.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e582b98673c3e1b3f8088c36ee372ba4354881ef1d9c3b1296eab954c3c06e3
|
4
|
+
data.tar.gz: 382fcf248e48fd0c7c9de5ad183630ea7afaa91da3d100f2a2535482fce843b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859631fb96df5e7a4dabac1a5ed8940c307607743305579bae196c0a5788ddb49eb0886bee952d949173c7b1337d19a1308578de8598fc2ae36de7029fa2579b
|
7
|
+
data.tar.gz: c7409a32cb58d9b7f2047a2cae281bec689971549e03bb4960391b53699378ebfbaeda16466778a06d98e4b91e5afffa0bf2bfa485e838ef294e80f14ca298a9
|
data/.travis.yml
CHANGED
@@ -1,24 +1,20 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
|
4
|
-
script: bundle exec ruby spec/unicode_scripts_spec.rb
|
5
|
-
|
6
4
|
rvm:
|
5
|
+
- 2.7
|
7
6
|
- 2.6
|
8
7
|
- 2.5
|
9
8
|
- 2.4
|
10
9
|
- 2.3
|
11
|
-
- 2.2
|
12
|
-
- 2.1
|
13
|
-
- 2.0
|
14
10
|
- ruby-head
|
15
|
-
- jruby-
|
16
|
-
-
|
11
|
+
- jruby-9.2.9.0
|
12
|
+
- truffleruby
|
17
13
|
|
18
14
|
matrix:
|
19
15
|
allow_failures:
|
20
16
|
- rvm: 2.3
|
21
|
-
- rvm:
|
22
|
-
- rvm: 2.
|
23
|
-
- rvm:
|
24
|
-
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-2.9.2.0
|
19
|
+
- rvm: truffleruby
|
20
|
+
# fast_finish: true
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
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: **13.0.0** (March 2020)
|
6
6
|
|
7
|
-
Supported Rubies: **2.6**, **2.5**, **2.4**
|
7
|
+
Supported Rubies: **2.7**, **2.6**, **2.5**, **2.4**
|
8
8
|
|
9
9
|
Old Rubies that might still work: **2.3**, **2.2**, **2.1**, **2.0**
|
10
10
|
|
@@ -34,13 +34,10 @@ Unicode::Scripts.script_extensions("॥")
|
|
34
34
|
"Syloti_Nagri", "Takri", "Tamil", "Telugu", "Tirhuta"]
|
35
35
|
```
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
37
|
## Hints
|
41
38
|
### Regex Matching
|
42
39
|
|
43
|
-
If you have a string and want to match a substring/character from a specific Unicode script, you actually won't need this gem. Instead, you can use the [Regexp Unicode Property Syntax `\p{}`](
|
40
|
+
If you have a string and want to match a substring/character from a specific Unicode script, you actually won't need this gem. Instead, you can use the [Regexp Unicode Property Syntax `\p{}`](https://ruby-doc.org/core/Regexp.html#class-Regexp-label-Character+Properties):
|
44
41
|
|
45
42
|
```ruby
|
46
43
|
"Coptic letter: ⲁ".scan(/\p{Coptic}/) # => ["ⲁ"]
|
@@ -81,6 +78,7 @@ Caucasian_Albanian
|
|
81
78
|
Chakma
|
82
79
|
Cham
|
83
80
|
Cherokee
|
81
|
+
Chorasmian
|
84
82
|
Common
|
85
83
|
Coptic
|
86
84
|
Cuneiform
|
@@ -88,6 +86,7 @@ Cypriot
|
|
88
86
|
Cyrillic
|
89
87
|
Deseret
|
90
88
|
Devanagari
|
89
|
+
Dives_Akuru
|
91
90
|
Dogra
|
92
91
|
Duployan
|
93
92
|
Egyptian_Hieroglyphs
|
@@ -120,6 +119,7 @@ Katakana
|
|
120
119
|
Katakana_Or_Hiragana
|
121
120
|
Kayah_Li
|
122
121
|
Kharoshthi
|
122
|
+
Khitan_Small_Script
|
123
123
|
Khmer
|
124
124
|
Khojki
|
125
125
|
Khudawadi
|
@@ -210,6 +210,7 @@ Unknown
|
|
210
210
|
Vai
|
211
211
|
Wancho
|
212
212
|
Warang_Citi
|
213
|
+
Yezidi
|
213
214
|
Yi
|
214
215
|
Zanabazar_Square
|
215
216
|
```
|
@@ -247,10 +248,12 @@ Cans
|
|
247
248
|
Cari
|
248
249
|
Cham
|
249
250
|
Cher
|
251
|
+
Chrs
|
250
252
|
Copt
|
251
253
|
Cprt
|
252
254
|
Cyrl
|
253
255
|
Deva
|
256
|
+
Diak
|
254
257
|
Dogr
|
255
258
|
Dsrt
|
256
259
|
Dupl
|
@@ -285,6 +288,7 @@ Kana
|
|
285
288
|
Khar
|
286
289
|
Khmr
|
287
290
|
Khoj
|
291
|
+
Kits
|
288
292
|
Knda
|
289
293
|
Kthi
|
290
294
|
Lana
|
@@ -375,6 +379,7 @@ Wara
|
|
375
379
|
Wcho
|
376
380
|
Xpeo
|
377
381
|
Xsux
|
382
|
+
Yezi
|
378
383
|
Yiii
|
379
384
|
Zanb
|
380
385
|
Zinh
|
@@ -386,5 +391,5 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
386
391
|
|
387
392
|
## MIT License
|
388
393
|
|
389
|
-
- Copyright (C) 2016-
|
390
|
-
- Unicode data:
|
394
|
+
- Copyright (C) 2016-2020 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
395
|
+
- 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.6.0"
|
6
|
+
UNICODE_VERSION = "13.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
|
@@ -18,8 +18,13 @@ describe Unicode::Scripts do
|
|
18
18
|
|
19
19
|
it "will call .script for every character" do
|
20
20
|
mocked_method = MiniTest::Mock.new
|
21
|
-
|
22
|
-
|
21
|
+
if RUBY_VERSION >= "2.7"
|
22
|
+
mocked_method.expect :call, "first script", ["С"]
|
23
|
+
mocked_method.expect :call, "second script", ["A"]
|
24
|
+
else
|
25
|
+
mocked_method.expect :call, "first script", ["С", {}]
|
26
|
+
mocked_method.expect :call, "second script", ["A", {}]
|
27
|
+
end
|
23
28
|
Unicode::Scripts.stub :script, mocked_method do
|
24
29
|
Unicode::Scripts.of("СA")
|
25
30
|
end
|
data/unicode-scripts.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.summary = "Which script(s) does a Unicode string belong to?"
|
9
9
|
gem.description = "[Unicode #{Unicode::Scripts::UNICODE_VERSION}] Retrieve the Unicode script(s) 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'. "
|
10
10
|
gem.authors = ["Jan Lelis"]
|
11
|
-
gem.email = ["
|
11
|
+
gem.email = ["hi@ruby.consulting"]
|
12
12
|
gem.homepage = "https://github.com/janlelis/unicode-scripts"
|
13
13
|
gem.license = "MIT"
|
14
14
|
|
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.required_ruby_version = "
|
20
|
+
gem.required_ruby_version = ">= 2.0"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.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: 2020-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Unicode
|
13
|
+
description: "[Unicode 13.0.0] Retrieve the Unicode script(s) a string belongs to.
|
14
14
|
Can also return the Script_Extension property which is defined as characters which
|
15
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: []
|
19
19
|
extensions: []
|
20
20
|
extra_rdoc_files: []
|
@@ -45,7 +45,7 @@ require_paths:
|
|
45
45
|
- lib
|
46
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- - "
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: '2.0'
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.1.2
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Which script(s) does a Unicode string belong to?
|