unicode-numeric_value 1.9.0 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +14 -8
- data/MIT-LICENSE.txt +1 -1
- data/README.md +5 -4
- data/data/numeric_value.marshal.gz +0 -0
- data/lib/unicode/numeric_value/constants.rb +2 -2
- data/spec/unicode_numeric_value_spec.rb +6 -2
- data/unicode-numeric_value.gemspec +1 -0
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '090561d907e6eb6381779c7eef541b9866e5d6a7e774e6e47128b853f601cfc0'
|
4
|
+
data.tar.gz: a0b05674a97172b71ef207e7335c6a0c7d7b505fa5e7898228393d6e3b258610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 383a11cacf6fcdc9d713e7c5f066d398eee0ff62d84f06435a17c3a252575fb044ca4bde4cd9b490a70feeef22652fbdbb3ac9cf61aba9354cf9649830aeac12
|
7
|
+
data.tar.gz: 5fac1ae759d2c36026614210b1f1f592452db1a0ce2402a7b14a7d4334656a4ab2f5944a0ee75bf1bbb08eef648789d7673db0421ee6a8f28a2c45119f452a7c
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unicode-numeric_value (1.
|
4
|
+
unicode-numeric_value (1.11.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
io-console (0.
|
10
|
-
irb (1.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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)
|
15
20
|
io-console (~> 0.5)
|
21
|
+
stringio (3.0.8)
|
16
22
|
|
17
23
|
PLATFORMS
|
18
24
|
ruby
|
@@ -24,4 +30,4 @@ DEPENDENCIES
|
|
24
30
|
unicode-numeric_value!
|
25
31
|
|
26
32
|
BUNDLED WITH
|
27
|
-
|
33
|
+
2.4.4
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Convert a Unicode character into its numeric value.
|
4
4
|
|
5
|
-
Unicode version: **
|
5
|
+
Unicode version: **16.0.0** (September 2024)
|
6
6
|
|
7
|
-
Supported Rubies: **3.
|
7
|
+
Supported Rubies: **3.3**, **3.2**, **3.1**, **3.0**
|
8
8
|
|
9
|
-
Old Rubies that might still work: **2.
|
9
|
+
Old Rubies that might still work: **2.7**, **2.6**, **2.5**, **2.4**, **2.3**, **2.X**
|
10
10
|
|
11
11
|
## Gemfile
|
12
12
|
|
@@ -29,6 +29,7 @@ Unicode::NumericValue.of("༳") # => (-1/2)
|
|
29
29
|
Unicode::NumericValue.of("𑿀") # => (1/320)
|
30
30
|
Unicode::NumericValue.of("𖭡") # => 1000000000000
|
31
31
|
Unicode::NumericValue.of("五") # => 5
|
32
|
+
Unicode::NumericValue.of("") # => 7
|
32
33
|
Unicode::NumericValue.of("A") # => nil
|
33
34
|
```
|
34
35
|
|
@@ -61,5 +62,5 @@ puts "Codepoint | Character | Numeric Value | Name\n" \
|
|
61
62
|
|
62
63
|
## MIT License
|
63
64
|
|
64
|
-
- Copyright (C) 2016-
|
65
|
+
- Copyright (C) 2016-2024 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
65
66
|
- 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.11.0"
|
6
|
+
UNICODE_VERSION = "16.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
|
@@ -10,14 +10,18 @@ describe Unicode::NumericValue do
|
|
10
10
|
assert_equal 1000000000000, Unicode::NumericValue.of("𖭡")
|
11
11
|
end
|
12
12
|
|
13
|
+
it "works with numbers from Unicode 16 (2024)" do
|
14
|
+
assert_equal 7, Unicode::NumericValue.of("")
|
15
|
+
end
|
16
|
+
|
13
17
|
it "will return rational values" do
|
14
18
|
assert_equal 3/4r, Unicode::NumericValue.of("¾")
|
15
19
|
assert_equal -1/2r, Unicode::NumericValue.of("༳")
|
16
20
|
end
|
17
21
|
|
18
22
|
it "will return nil if no numeric value associated" do
|
19
|
-
|
20
|
-
|
23
|
+
assert_nil Unicode::NumericValue.of("A")
|
24
|
+
assert_nil Unicode::NumericValue.of("\0")
|
21
25
|
end
|
22
26
|
|
23
27
|
it "works with numbers from recent Unicode versions" do
|
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
+
gem.metadata = { "rubygems_mfa_required" => "true" }
|
19
20
|
|
20
21
|
gem.required_ruby_version = ">= 2.0"
|
21
22
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
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.11.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: 2024-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: "[Unicode
|
13
|
+
description: "[Unicode 16.0.0] Returns the numeric value associated with a Unicode
|
14
14
|
character"
|
15
15
|
email:
|
16
16
|
- hi@ruby.consulting
|
@@ -37,8 +37,9 @@ files:
|
|
37
37
|
homepage: https://github.com/janlelis/unicode-numeric_value
|
38
38
|
licenses:
|
39
39
|
- MIT
|
40
|
-
metadata:
|
41
|
-
|
40
|
+
metadata:
|
41
|
+
rubygems_mfa_required: 'true'
|
42
|
+
post_install_message:
|
42
43
|
rdoc_options: []
|
43
44
|
require_paths:
|
44
45
|
- lib
|
@@ -53,8 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0'
|
55
56
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
57
|
-
signing_key:
|
57
|
+
rubygems_version: 3.5.9
|
58
|
+
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: Returns the numeric value associated with a Unicode character
|
60
61
|
test_files:
|