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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 859ec6ffd69250038b8c42c828bc3e501ddd3d2f
4
- data.tar.gz: dc642269349c00386b6f8ff45f7606d455a97d51
3
+ metadata.gz: 81d9ee2223dc420cf89ba26688ca9f924403ddfd
4
+ data.tar.gz: e1f5a75f5b60a2b08c2eff7f96f2a09df2f5cd44
5
5
  SHA512:
6
- metadata.gz: a131bb50c40c8790ac437deffa233bf11e9668d7a9d9f712f229d3cc473f58f862ee7e672caf473f865368717d70c339e4cac5cae687aa4b04e74f41c264021c
7
- data.tar.gz: 6900b3843a756e5b5062115f3247e050886788c4869e8e76cf7fddfa0a18b8117da126c920e743350b451d95903bb15a8f327f80271077c14707c790412b84ce
6
+ metadata.gz: 955e334de235a394cef1647b190aada72e8c0b6a7ad109ffec92b18dbf92fc1b3e341420dc0f5713df1b2f7075b9259934c2e1114c08d157cfdfe2cdf05182a4
7
+ data.tar.gz: 02e8f9b36e889c9a621355710845ca71e67ef9db082abf414e5e79a523e7474997fa01ea555ca294c5f932620111fd1b227bcd84beef1fbe892fcb11c884b9f0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.4.2
4
+
5
+ * Fix that Unicode::Name.correct would not fail if codepoint has aliases but no correction
6
+
3
7
  ### 1.4.1
4
8
 
5
9
  * Be compatible with Ruby 2.4's surrogate literals
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] && INDEX[:ALIASES][codepoint][:correction][-1]
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.1".freeze
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
@@ -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.1
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-19 00:00:00.000000000 Z
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