unicode-numeric_value 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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +31 -13
- data/MIT-LICENSE.txt +1 -1
- data/README.md +3 -2
- data/data/numeric_value.marshal.gz +0 -0
- data/lib/unicode/numeric_value/constants.rb +2 -2
- data/spec/unicode_numeric_value_spec.rb +9 -4
- 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: 03aa3f01a99320487f114b05ceb3a666481413826958c0d5738f3adbdc048666
|
|
4
|
+
data.tar.gz: d155578489f0291c88f528e6b691cc9a84b6b7e52e5e8e11be975a392b04cbee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b78dff35fa16a9b63cc0222a907522a55d5a2050fd9e6012583e34bcce09a6705ba732d892497633c2fed1f4672e48c6606da739290f8ecf2e7f2234d0ac25e
|
|
7
|
+
data.tar.gz: f1c2a2d0869f0845726d06ef5890361a9793c936f4fa460737ba13db2fae0c1a789c78c5c0707f4218bf5733923468bd8ba0e7114b31346166cfbb7d3d23cf55
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
unicode-numeric_value (1.
|
|
4
|
+
unicode-numeric_value (1.13.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
|
+
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
|
-
|
|
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-numeric_value!
|
|
31
49
|
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Convert a Unicode character into its numeric value.
|
|
4
4
|
|
|
5
|
-
Unicode version: **
|
|
5
|
+
Unicode version: **18.0.0** (September 2026)
|
|
6
6
|
|
|
7
7
|
## Gemfile
|
|
8
8
|
|
|
@@ -55,8 +55,9 @@ puts "Codepoint | Character | Numeric Value | Name\n" \
|
|
|
55
55
|
## Also See
|
|
56
56
|
|
|
57
57
|
- [unicode-x](https://github.com/janlelis/unicode-x): more Unicode related micro libraries
|
|
58
|
+
- JavaScript version: [unicode-number.js](https://github.com/janlelis/unicode-number.js)
|
|
58
59
|
|
|
59
60
|
## MIT License
|
|
60
61
|
|
|
61
|
-
- Copyright (C) 2016-
|
|
62
|
+
- Copyright (C) 2016-2026 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
|
62
63
|
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
|
Binary file
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Unicode
|
|
4
4
|
module NumericValue
|
|
5
|
-
VERSION = "1.
|
|
6
|
-
UNICODE_VERSION = "
|
|
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 + "/numeric_value.marshal.gz").freeze
|
|
9
9
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative "../lib/unicode/numeric_value"
|
|
2
|
+
require "minitest/mock"
|
|
2
3
|
require "minitest/autorun"
|
|
3
4
|
|
|
4
5
|
describe Unicode::NumericValue do
|
|
@@ -10,6 +11,10 @@ describe Unicode::NumericValue do
|
|
|
10
11
|
assert_equal 1000000000000, Unicode::NumericValue.of("𖭡")
|
|
11
12
|
end
|
|
12
13
|
|
|
14
|
+
it "works with numbers from Unicode 18 (2026)" do
|
|
15
|
+
assert_equal 7, Unicode::NumericValue.of("\u{1257F}")
|
|
16
|
+
end
|
|
17
|
+
|
|
13
18
|
it "works with numbers from Unicode 17 (2025)" do
|
|
14
19
|
assert_equal 1, Unicode::NumericValue.of("")
|
|
15
20
|
end
|
|
@@ -18,6 +23,10 @@ describe Unicode::NumericValue do
|
|
|
18
23
|
assert_equal 7, Unicode::NumericValue.of("")
|
|
19
24
|
end
|
|
20
25
|
|
|
26
|
+
it "works with numbers from Unicode 15 (2023)" do
|
|
27
|
+
assert_equal 0, Unicode::NumericValue.of("𝋀")
|
|
28
|
+
end
|
|
29
|
+
|
|
21
30
|
it "will return rational values" do
|
|
22
31
|
assert_equal 3/4r, Unicode::NumericValue.of("¾")
|
|
23
32
|
assert_equal -1/2r, Unicode::NumericValue.of("༳")
|
|
@@ -27,10 +36,6 @@ describe Unicode::NumericValue do
|
|
|
27
36
|
assert_nil Unicode::NumericValue.of("A")
|
|
28
37
|
assert_nil Unicode::NumericValue.of("\0")
|
|
29
38
|
end
|
|
30
|
-
|
|
31
|
-
it "works with numbers from recent Unicode versions" do
|
|
32
|
-
assert_equal 0, Unicode::NumericValue.of("𝋀") # Unicode 15.0
|
|
33
|
-
end
|
|
34
39
|
end
|
|
35
40
|
|
|
36
41
|
describe ".chars" do
|
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unicode-numeric_value
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
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:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
|
-
description: "[Unicode
|
|
12
|
+
description: "[Unicode 18.0.0] Returns the numeric value associated with a Unicode
|
|
14
13
|
character"
|
|
15
14
|
email:
|
|
16
15
|
- hi@ruby.consulting
|
|
@@ -39,7 +38,6 @@ licenses:
|
|
|
39
38
|
- MIT
|
|
40
39
|
metadata:
|
|
41
40
|
rubygems_mfa_required: 'true'
|
|
42
|
-
post_install_message:
|
|
43
41
|
rdoc_options: []
|
|
44
42
|
require_paths:
|
|
45
43
|
- lib
|
|
@@ -54,8 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
54
52
|
- !ruby/object:Gem::Version
|
|
55
53
|
version: '0'
|
|
56
54
|
requirements: []
|
|
57
|
-
rubygems_version:
|
|
58
|
-
signing_key:
|
|
55
|
+
rubygems_version: 4.0.21
|
|
59
56
|
specification_version: 4
|
|
60
57
|
summary: Returns the numeric value associated with a Unicode character
|
|
61
58
|
test_files:
|