camertron-eprun 2.0.0 → 2.0.1
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 +3 -0
- data/Gemfile +1 -0
- data/lib/eprun/v14_0_0/tables.rb +2 -4
- data/lib/eprun/v15_1_0/tables.rb +2 -4
- data/lib/eprun/v16_0_0/tables.rb +2 -4
- data/lib/eprun/v17_0_0/tables.rb +2 -4
- data/lib/eprun/v18_0_0/tables.rb +2 -4
- data/lib/eprun/version.rb +1 -1
- data/lib/eprun.rb +2 -2
- data/test/test_normalize.rb +26 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d717364f04a54e9a735a051300e3e95a45da9b77ee684492dba168e2e022b399
|
|
4
|
+
data.tar.gz: 12d9342da34767b7f0d327d52a7a9f25b6780ea6b826b783048cc90b497c7dfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccbe83e39877f83318a43a58879e12d274bab3f6bfb4d47f74994958302a82a733d355d14a6b2bbe8759f8c1f19d8fbffde636ef5e37143e756d6819425ffa6c
|
|
7
|
+
data.tar.gz: 134d37aea675f15ff462d9422a9e48de8c8a8b8069ad8ac77960b0572e5822e9ff6864091b635c05e428acaf68c39d0c212a48c6323ff88ef18607cbb2446db7
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/eprun/v14_0_0/tables.rb
CHANGED
data/lib/eprun/v15_1_0/tables.rb
CHANGED
data/lib/eprun/v16_0_0/tables.rb
CHANGED
data/lib/eprun/v17_0_0/tables.rb
CHANGED
data/lib/eprun/v18_0_0/tables.rb
CHANGED
data/lib/eprun/version.rb
CHANGED
data/lib/eprun.rb
CHANGED
|
@@ -17,11 +17,11 @@ module Eprun
|
|
|
17
17
|
|
|
18
18
|
class << self
|
|
19
19
|
def current_version
|
|
20
|
-
|
|
20
|
+
Fiber[:__eprun_current_version__]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def current_version=(new_version)
|
|
24
|
-
|
|
24
|
+
Fiber[:__eprun_current_version__] = Eprun::UcdVersion.get(new_version)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def normalize(*args)
|
data/test/test_normalize.rb
CHANGED
|
@@ -58,7 +58,11 @@ class TestNormalize < Test::Unit::TestCase
|
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
def self.ucd_versions
|
|
62
|
+
Array(ENV.fetch("UCD_VERSION", Eprun::UCD_VERSIONS))
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
ucd_versions.each do |ucd_version|
|
|
62
66
|
Eprun.with_version(ucd_version) do
|
|
63
67
|
# source; NFC; NFD; NFKC; NFKD
|
|
64
68
|
#
|
|
@@ -147,7 +151,7 @@ class TestNormalize < Test::Unit::TestCase
|
|
|
147
151
|
end
|
|
148
152
|
end
|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
ucd_versions.each do |ucd_version|
|
|
151
155
|
Eprun.with_version(ucd_version) do
|
|
152
156
|
generate_test_check_true :NFC, :nfc
|
|
153
157
|
generate_test_check_true :NFD, :nfd
|
|
@@ -195,4 +199,24 @@ class TestNormalize < Test::Unit::TestCase
|
|
|
195
199
|
assert_equal utf8('\u1100\u1161\u0323\u0300'), Eprun.normalize(utf8('\uAC00\u0300\u0323'), :nfd)
|
|
196
200
|
assert_equal utf8('\u1100\u1161\u0323\u0300'), Eprun.normalize(utf8('\u1100\u1161\u0300\u0323'), :nfd)
|
|
197
201
|
end
|
|
202
|
+
|
|
203
|
+
def test_combining_sequences_ordered_together
|
|
204
|
+
# The following example comes from the Unicode collation tests. In this example,
|
|
205
|
+
# the 0F81 decomposes into 0F71 0F80, which have combining classes of 129 and 130
|
|
206
|
+
# respectively. The 0591 that comes logically earlier in the codepoint sequence
|
|
207
|
+
# has a combining class of 220. Because Ruby's NFD normalization algorithm decomposes
|
|
208
|
+
# subsections of the string rather than the entire string at once, earlier
|
|
209
|
+
# implementations processed 0FB2 and 0591 in isolation, which generated a string
|
|
210
|
+
# with combining classes 0 220 129 130 0, which is not the correct canonical order;
|
|
211
|
+
# 0591 (combining class of 220) should be ordered after 0F80 (combining class of
|
|
212
|
+
# 130). This test ensures correct ordering is observed for such cases.
|
|
213
|
+
a = "\u0FB2\u0591\u0F81\u0061"
|
|
214
|
+
assert_equal("\u0FB2\u0F71\u0F80\u0591\u0061", Eprun.normalize(a, :nfd))
|
|
215
|
+
|
|
216
|
+
# This tests that the logic above holds when the sequence starts with a decomposition
|
|
217
|
+
# starter. 00C0 decomposes to 0041 0300 and 0F81 decomposes to 0F71 0F80, all of
|
|
218
|
+
# which have combining classes > 0 and must be ordered with 0591.
|
|
219
|
+
a = "\u00C0\u0591\u0F81"
|
|
220
|
+
assert_equal("\u0041\u0F71\u0F80\u0591\u0300", Eprun.normalize(a, :nfd))
|
|
221
|
+
end
|
|
198
222
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: camertron-eprun
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ayumu Nojima (野島 歩)
|
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
requirements: []
|
|
63
|
-
rubygems_version: 4.0.
|
|
63
|
+
rubygems_version: 4.0.23
|
|
64
64
|
specification_version: 4
|
|
65
65
|
summary: Efficient pure Ruby Unicode normalization.
|
|
66
66
|
test_files: []
|