unicode-name 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/unicode/name.rb +3 -1
- data/lib/unicode/name/.constants.rb.swp +0 -0
- data/lib/unicode/name/constants.rb +1 -1
- data/spec/unicode_name_spec.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81d9ee2223dc420cf89ba26688ca9f924403ddfd
|
4
|
+
data.tar.gz: e1f5a75f5b60a2b08c2eff7f96f2a09df2f5cd44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 955e334de235a394cef1647b190aada72e8c0b6a7ad109ffec92b18dbf92fc1b3e341420dc0f5713df1b2f7075b9259934c2e1114c08d157cfdfe2cdf05182a4
|
7
|
+
data.tar.gz: 02e8f9b36e889c9a621355710845ca71e67ef9db082abf414e5e79a523e7474997fa01ea555ca294c5f932620111fd1b227bcd84beef1fbe892fcb11c884b9f0
|
data/CHANGELOG.md
CHANGED
data/lib/unicode/name.rb
CHANGED
@@ -26,7 +26,9 @@ module Unicode
|
|
26
26
|
def self.correct(char)
|
27
27
|
codepoint = char.unpack("U")[0]
|
28
28
|
require_relative "name/index" unless defined? ::Unicode::Name::INDEX
|
29
|
-
if correction = INDEX[:ALIASES][codepoint] &&
|
29
|
+
if correction = INDEX[:ALIASES][codepoint] &&
|
30
|
+
INDEX[:ALIASES][codepoint][:correction] &&
|
31
|
+
INDEX[:ALIASES][codepoint][:correction][-1]
|
30
32
|
correction
|
31
33
|
else
|
32
34
|
unicode_name(char)
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Unicode
|
2
2
|
module Name
|
3
|
-
VERSION = "1.4.
|
3
|
+
VERSION = "1.4.2".freeze
|
4
4
|
UNICODE_VERSION = "9.0.0".freeze
|
5
5
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
|
6
6
|
INDEX_FILENAME = (DATA_DIRECTORY + '/name.marshal.gz').freeze
|
data/spec/unicode_name_spec.rb
CHANGED
@@ -29,6 +29,10 @@ describe Unicode::Name do
|
|
29
29
|
assert_equal "LATIN CAPITAL LETTER A", Unicode::Name.correct("A")
|
30
30
|
end
|
31
31
|
|
32
|
+
it "returns nothing if no name or correction alias exsits" do
|
33
|
+
assert_nil Unicode::Name.correct("\0")
|
34
|
+
end
|
35
|
+
|
32
36
|
it "will return corrected name, if one exists" do
|
33
37
|
assert_equal "LATIN CAPITAL LETTER GHA", Unicode::Name.correct("Ƣ")
|
34
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-name
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode-types
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- Rakefile
|
48
48
|
- data/name.marshal.gz
|
49
49
|
- lib/unicode/name.rb
|
50
|
+
- lib/unicode/name/.constants.rb.swp
|
50
51
|
- lib/unicode/name/constants.rb
|
51
52
|
- lib/unicode/name/index.rb
|
52
53
|
- lib/unicode/name/string_ext.rb
|