unicode-blocks 1.10.0 → 1.12.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 +9 -0
- data/Gemfile +4 -1
- data/Gemfile.lock +35 -14
- data/MIT-LICENSE.txt +1 -1
- data/README.md +18 -7
- data/data/blocks.marshal.gz +0 -0
- data/lib/unicode/blocks/constants.rb +2 -2
- data/lib/unicode/blocks.rb +2 -2
- data/spec/unicode_blocks_spec.rb +1 -0
- metadata +4 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b28ef8e235f75cf844cf2acdbad86cfed9fc20d8f641f5fe880067cd36bbdb8
|
|
4
|
+
data.tar.gz: 74a319f9bd1d41de94e3df2ca15c0429927a60e87a8f1c6b0fee700591e79f83
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 775bf1111b5e84558f6cfc975c09a5b722c5978864377d237b9f91eb9480e0169ecaf3030e28b00b60949824ef63c3eed3a071dbf7a7d9f25a6574773605c9c6
|
|
7
|
+
data.tar.gz: f26782698718c6f6e899612f032fd3fecf5b749e1c4fd316fccb11229f8de12c7c8ebfdd7d269d68fd3b08827174c54e503cc3fdb957123b6f8f7600b514b6e2
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
unicode-blocks (1.
|
|
4
|
+
unicode-blocks (1.12.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
+
ostruct (0.6.3)
|
|
23
|
+
pp (0.6.4)
|
|
24
|
+
prettyprint
|
|
25
|
+
prettyprint (0.2.0)
|
|
26
|
+
prism (1.9.0)
|
|
27
|
+
rake (13.4.2)
|
|
28
|
+
rbs (4.2.0)
|
|
29
|
+
logger
|
|
30
|
+
prism (>= 1.6.0)
|
|
31
|
+
tsort
|
|
32
|
+
rdoc (8.0.0)
|
|
33
|
+
erb
|
|
34
|
+
prism (>= 1.6.0)
|
|
35
|
+
rbs (>= 4.0.0)
|
|
36
|
+
tsort
|
|
37
|
+
reline (0.7.0)
|
|
20
38
|
io-console (~> 0.5)
|
|
21
|
-
|
|
39
|
+
tsort (0.2.0)
|
|
22
40
|
|
|
23
41
|
PLATFORMS
|
|
24
42
|
ruby
|
|
@@ -26,8 +44,11 @@ PLATFORMS
|
|
|
26
44
|
DEPENDENCIES
|
|
27
45
|
irb
|
|
28
46
|
minitest
|
|
47
|
+
minitest-mock
|
|
48
|
+
ostruct
|
|
29
49
|
rake
|
|
50
|
+
tsort
|
|
30
51
|
unicode-blocks!
|
|
31
52
|
|
|
32
53
|
BUNDLED WITH
|
|
33
|
-
|
|
54
|
+
4.1.0.beta1
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Each Unicode character belongs to a [block](https://en.wikipedia.org/wiki/Unicode_block). This gem returns the all blocks associated with the given string.
|
|
4
4
|
|
|
5
|
-
Unicode version: **
|
|
6
|
-
|
|
7
|
-
Supported Rubies: **3.3**, **3.2**, **3.1**, **3.0**
|
|
8
|
-
|
|
9
|
-
Old Rubies which might still work: **2.7**, **2.6**, **2.5**, **2.4**, **2.3**, **2.X**
|
|
5
|
+
Unicode version: **18.0.0** (September 2026)
|
|
10
6
|
|
|
11
7
|
## Gemfile
|
|
12
8
|
|
|
@@ -253,6 +249,7 @@ Nabataean
|
|
|
253
249
|
Hatran
|
|
254
250
|
Phoenician
|
|
255
251
|
Lydian
|
|
252
|
+
Sidetic
|
|
256
253
|
Meroitic Hieroglyphs
|
|
257
254
|
Meroitic Cursive
|
|
258
255
|
Kharoshthi
|
|
@@ -304,11 +301,14 @@ Soyombo
|
|
|
304
301
|
Unified Canadian Aboriginal Syllabics Extended-A
|
|
305
302
|
Pau Cin Hau
|
|
306
303
|
Devanagari Extended-A
|
|
304
|
+
Sharada Supplement
|
|
307
305
|
Sunuwar
|
|
308
306
|
Bhaiksuki
|
|
309
307
|
Marchen
|
|
310
308
|
Masaram Gondi
|
|
311
309
|
Gunjala Gondi
|
|
310
|
+
Tolong Siki
|
|
311
|
+
Bengali Supplement
|
|
312
312
|
Makasar
|
|
313
313
|
Kawi
|
|
314
314
|
Lisu Supplement
|
|
@@ -316,6 +316,7 @@ Tamil Supplement
|
|
|
316
316
|
Cuneiform
|
|
317
317
|
Cuneiform Numbers and Punctuation
|
|
318
318
|
Early Dynastic Cuneiform
|
|
319
|
+
Archaic Cuneiform Numerals
|
|
319
320
|
Cypro-Minoan
|
|
320
321
|
Egyptian Hieroglyphs
|
|
321
322
|
Egyptian Hieroglyph Format Controls
|
|
@@ -329,12 +330,16 @@ Bassa Vah
|
|
|
329
330
|
Pahawh Hmong
|
|
330
331
|
Kirat Rai
|
|
331
332
|
Medefaidrin
|
|
333
|
+
Beria Erfe
|
|
332
334
|
Miao
|
|
333
335
|
Ideographic Symbols and Punctuation
|
|
334
336
|
Tangut
|
|
335
337
|
Tangut Components
|
|
336
338
|
Khitan Small Script
|
|
337
339
|
Tangut Supplement
|
|
340
|
+
Tangut Components Supplement
|
|
341
|
+
Jurchen
|
|
342
|
+
Jurchen Radicals
|
|
338
343
|
Kana Extended-B
|
|
339
344
|
Kana Supplement
|
|
340
345
|
Kana Extended-A
|
|
@@ -343,16 +348,19 @@ Nushu
|
|
|
343
348
|
Duployan
|
|
344
349
|
Shorthand Format Controls
|
|
345
350
|
Symbols for Legacy Computing Supplement
|
|
351
|
+
Miscellaneous Symbols Supplement
|
|
346
352
|
Znamenny Musical Notation
|
|
347
353
|
Byzantine Musical Symbols
|
|
348
354
|
Musical Symbols
|
|
349
355
|
Ancient Greek Musical Notation
|
|
356
|
+
Musical Symbols Supplement
|
|
350
357
|
Kaktovik Numerals
|
|
351
358
|
Mayan Numerals
|
|
352
359
|
Tai Xuan Jing Symbols
|
|
353
360
|
Counting Rod Numerals
|
|
354
361
|
Mathematical Alphanumeric Symbols
|
|
355
362
|
Sutton SignWriting
|
|
363
|
+
Miscellaneous Symbols and Arrows Extended
|
|
356
364
|
Latin Extended-G
|
|
357
365
|
Glagolitic Supplement
|
|
358
366
|
Cyrillic Extended-D
|
|
@@ -361,6 +369,7 @@ Toto
|
|
|
361
369
|
Wancho
|
|
362
370
|
Nag Mundari
|
|
363
371
|
Ol Onal
|
|
372
|
+
Tai Yo
|
|
364
373
|
Ethiopic Extended-B
|
|
365
374
|
Mende Kikakui
|
|
366
375
|
Adlam
|
|
@@ -392,15 +401,17 @@ CJK Unified Ideographs Extension I
|
|
|
392
401
|
CJK Compatibility Ideographs Supplement
|
|
393
402
|
CJK Unified Ideographs Extension G
|
|
394
403
|
CJK Unified Ideographs Extension H
|
|
404
|
+
CJK Unified Ideographs Extension J
|
|
405
|
+
Seal
|
|
395
406
|
Tags
|
|
396
407
|
Variation Selectors Supplement
|
|
397
408
|
Supplementary Private Use Area-A
|
|
398
409
|
Supplementary Private Use Area-B
|
|
399
410
|
```
|
|
400
411
|
|
|
401
|
-
See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related micro libraries.
|
|
412
|
+
See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related micro libraries and [unicode-block.js](https://www.npmjs.com/package/unicode-block) for a JavaScript version of this library.
|
|
402
413
|
|
|
403
414
|
## MIT License
|
|
404
415
|
|
|
405
|
-
- Copyright (C) 2016-
|
|
416
|
+
- Copyright (C) 2016-2026 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
|
406
417
|
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
data/data/blocks.marshal.gz
CHANGED
|
Binary file
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Unicode
|
|
4
4
|
module Blocks
|
|
5
|
-
VERSION = "1.
|
|
6
|
-
UNICODE_VERSION = "
|
|
5
|
+
VERSION = "1.12.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 + "/blocks.marshal.gz").freeze
|
|
9
9
|
end
|
data/lib/unicode/blocks.rb
CHANGED
|
@@ -15,13 +15,13 @@ module Unicode
|
|
|
15
15
|
def self.block(char)
|
|
16
16
|
require_relative 'blocks/index' unless defined? ::Unicode::Blocks::INDEX
|
|
17
17
|
codepoint = char.unpack("U")[0] or raise(ArgumentError, "Unicode::Blocks.block must be given a valid char")
|
|
18
|
-
block_info = INDEX.bsearch{ |block_info| codepoint <= block_info[1] }
|
|
18
|
+
block_info = INDEX[:BLOCKS].bsearch{ |block_info| codepoint <= block_info[1] }
|
|
19
19
|
codepoint >= block_info[0] ? block_info[2] : "No_Block"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def self.names
|
|
23
23
|
require_relative 'blocks/index' unless defined? ::Unicode::Blocks::INDEX
|
|
24
|
-
INDEX.map(&:last)
|
|
24
|
+
INDEX[:BLOCKS].map(&:last)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
data/spec/unicode_blocks_spec.rb
CHANGED
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unicode-blocks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jan Lelis
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
|
-
description: "[Unicode
|
|
12
|
+
description: "[Unicode 18.0.0] Answers the question: Which Unicode block does a code
|
|
14
13
|
point belong to?"
|
|
15
14
|
email:
|
|
16
15
|
- hi@ruby.consulting
|
|
@@ -38,7 +37,6 @@ licenses:
|
|
|
38
37
|
- MIT
|
|
39
38
|
metadata:
|
|
40
39
|
rubygems_mfa_required: 'true'
|
|
41
|
-
post_install_message:
|
|
42
40
|
rdoc_options: []
|
|
43
41
|
require_paths:
|
|
44
42
|
- lib
|
|
@@ -53,8 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
53
51
|
- !ruby/object:Gem::Version
|
|
54
52
|
version: '0'
|
|
55
53
|
requirements: []
|
|
56
|
-
rubygems_version:
|
|
57
|
-
signing_key:
|
|
54
|
+
rubygems_version: 4.0.3
|
|
58
55
|
specification_version: 4
|
|
59
56
|
summary: Return Unicode blocks of a string.
|
|
60
57
|
test_files:
|