unicode-numeric_value 1.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '090561d907e6eb6381779c7eef541b9866e5d6a7e774e6e47128b853f601cfc0'
4
- data.tar.gz: a0b05674a97172b71ef207e7335c6a0c7d7b505fa5e7898228393d6e3b258610
3
+ metadata.gz: 03aa3f01a99320487f114b05ceb3a666481413826958c0d5738f3adbdc048666
4
+ data.tar.gz: d155578489f0291c88f528e6b691cc9a84b6b7e52e5e8e11be975a392b04cbee
5
5
  SHA512:
6
- metadata.gz: 383a11cacf6fcdc9d713e7c5f066d398eee0ff62d84f06435a17c3a252575fb044ca4bde4cd9b490a70feeef22652fbdbb3ac9cf61aba9354cf9649830aeac12
7
- data.tar.gz: 5fac1ae759d2c36026614210b1f1f592452db1a0ce2402a7b14a7d4334656a4ab2f5944a0ee75bf1bbb08eef648789d7673db0421ee6a8f28a2c45119f452a7c
6
+ metadata.gz: 5b78dff35fa16a9b63cc0222a907522a55d5a2050fd9e6012583e34bcce09a6705ba732d892497633c2fed1f4672e48c6606da739290f8ecf2e7f2234d0ac25e
7
+ data.tar.gz: f1c2a2d0869f0845726d06ef5890361a9793c936f4fa460737ba13db2fae0c1a789c78c5c0707f4218bf5733923468bd8ba0e7114b31346166cfbb7d3d23cf55
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.13.0
4
+
5
+ - Unicode 18.0
6
+
7
+ ### 1.12.0
8
+
9
+ - Unicode 17.0
10
+ - Move index to INDEX[:NUMBERS] instead of just INDEX
11
+
3
12
  ### 1.11.0
4
13
 
5
14
  - Unicode 16.0
data/Gemfile CHANGED
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'minitest'
6
+ gem 'minitest-mock'
6
7
  gem 'rake'
7
- gem 'irb' unless RUBY_ENGINE == "jruby"
8
+ gem 'irb'
data/Gemfile.lock CHANGED
@@ -1,24 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unicode-numeric_value (1.11.0)
4
+ unicode-numeric_value (1.13.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
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)
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
- stringio (3.0.8)
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2024 Jan Lelis, https://janlelis.com
1
+ Copyright (c) 2016-2026 Jan Lelis, https://janlelis.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -2,11 +2,7 @@
2
2
 
3
3
  Convert a Unicode character into its numeric value.
4
4
 
5
- Unicode version: **16.0.0** (September 2024)
6
-
7
- Supported Rubies: **3.3**, **3.2**, **3.1**, **3.0**
8
-
9
- Old Rubies that 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
 
@@ -59,8 +55,9 @@ puts "Codepoint | Character | Numeric Value | Name\n" \
59
55
  ## Also See
60
56
 
61
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)
62
59
 
63
60
  ## MIT License
64
61
 
65
- - Copyright (C) 2016-2024 Jan Lelis <https://janlelis.com>. Released under the MIT license.
62
+ - Copyright (C) 2016-2026 Jan Lelis <https://janlelis.com>. Released under the MIT license.
66
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.11.0"
6
- UNICODE_VERSION = "16.0.0"
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
@@ -6,13 +6,13 @@ module Unicode
6
6
  codepoint = char.unpack("U")[0] or
7
7
  raise(ArgumentError, "Unicode::NumericValue.numeric_value must be given a valid char")
8
8
  require_relative "numeric_value/index" unless defined? ::Unicode::NumericValue::INDEX
9
- INDEX[codepoint]
9
+ INDEX[:NUMBERS][codepoint]
10
10
  end
11
11
  class << self; alias of numeric_value; end
12
12
 
13
13
  def self.chars
14
14
  require_relative "numeric_value/index" unless defined? ::Unicode::NumericValue::INDEX
15
- INDEX.keys.sort.map{ |codepoint| [codepoint].pack("U") }
15
+ INDEX[:NUMBERS].keys.sort.map{ |codepoint| [codepoint].pack("U") }
16
16
  end
17
17
  end
18
18
  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,10 +11,22 @@ 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
+
18
+ it "works with numbers from Unicode 17 (2025)" do
19
+ assert_equal 1, Unicode::NumericValue.of("𑷡")
20
+ end
21
+
13
22
  it "works with numbers from Unicode 16 (2024)" do
14
23
  assert_equal 7, Unicode::NumericValue.of("𜳷")
15
24
  end
16
25
 
26
+ it "works with numbers from Unicode 15 (2023)" do
27
+ assert_equal 0, Unicode::NumericValue.of("𝋀")
28
+ end
29
+
17
30
  it "will return rational values" do
18
31
  assert_equal 3/4r, Unicode::NumericValue.of("¾")
19
32
  assert_equal -1/2r, Unicode::NumericValue.of("༳")
@@ -23,10 +36,6 @@ describe Unicode::NumericValue do
23
36
  assert_nil Unicode::NumericValue.of("A")
24
37
  assert_nil Unicode::NumericValue.of("\0")
25
38
  end
26
-
27
- it "works with numbers from recent Unicode versions" do
28
- assert_equal 0, Unicode::NumericValue.of("𝋀") # Unicode 15.0
29
- end
30
39
  end
31
40
 
32
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.11.0
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: 2024-09-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description: "[Unicode 16.0.0] Returns the numeric value associated with a 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: 3.5.9
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: