unicode-confusable 1.4.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: ff7ca55c41e0ea741c409a0e98b1be63aa12b128788a04f52452dbe38a3d02a3
4
- data.tar.gz: 8b674ed826c9199f65b39daaeb5187c85e8511066c44f513c80e24f6bb6bdb04
3
+ metadata.gz: 75b8aaeac1757b067675420ceef3882d9846935bfb27678bf67575fb2d8fcbaf
4
+ data.tar.gz: 950e1ddbe829d6af8b4389bfa7ca3b63cc71f472fcab4e6ddbd1b3eeaf60ad10
5
5
  SHA512:
6
- metadata.gz: 0b29f5ece2f51581ff30c366f046052597a33289e2db8707d0675e12e48a747cf6cea0e4eeebac4ee41a433bccb435d395272eeff0363aad3f5ecbd67f0463ad
7
- data.tar.gz: a6b478be06b68db144fe3ad219bf994c0e30d67bef5a56791df0f017836d2570c1023e34a642869f6b5a83bf0d902e68c98c89f8072bb6c9ed934e3dbfa7c313
6
+ metadata.gz: 262ac3a5adfc105a5ca348b102627839048dff3977aa680e4516a82f7e365256f4438c44e3211daf449833710dd43d80b1ab182626214883f0df95db94d35060
7
+ data.tar.gz: 63642a6f211f5a8ea512080ee1fe1e21ec45f40b7ec68fce4949748ceaac8e57536ed5c5c3cacd9e480921ca3ea35f306293d5d9c004f5ebd57049395f4c72cc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.8.0
4
+
5
+ - Unicode 14.0
6
+
7
+ ### 1.7.0
8
+
9
+ - Unicode 13
10
+
11
+ ### 1.6.0
12
+
13
+ * Unicode 12.1
14
+
15
+ ### 1.5.0
16
+
17
+ * Unicode 12
18
+
3
19
  ### 1.4.0
4
20
 
5
21
  * Unicode 11
data/Gemfile CHANGED
@@ -4,4 +4,5 @@ gemspec
4
4
 
5
5
  gem 'minitest'
6
6
  gem 'rake'
7
+ gem 'irb' unless RUBY_ENGINE == "jruby"
7
8
 
data/Gemfile.lock CHANGED
@@ -1,21 +1,27 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unicode-confusable (1.3.0)
4
+ unicode-confusable (1.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ io-console (0.5.6)
10
+ irb (1.2.9)
11
+ reline (>= 0.1.5)
9
12
  minitest (5.10.2)
10
13
  rake (12.0.0)
14
+ reline (0.1.10)
15
+ io-console (~> 0.5)
11
16
 
12
17
  PLATFORMS
13
18
  ruby
14
19
 
15
20
  DEPENDENCIES
21
+ irb
16
22
  minitest
17
23
  rake
18
24
  unicode-confusable!
19
25
 
20
26
  BUNDLED WITH
21
- 1.14.6
27
+ 2.1.4
data/MIT-LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2018 Jan Lelis, mail@janlelis.de
1
+ Copyright (c) 2016-2021 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
@@ -1,12 +1,14 @@
1
- # Unicode::Confusable [![[version]](https://badge.fury.io/rb/unicode-confusable.svg)](http://badge.fury.io/rb/unicode-confusable) [![[travis]](https://travis-ci.org/janlelis/unicode-confusable.png)](https://travis-ci.org/janlelis/unicode-confusable)
1
+ # Unicode::Confusable [![[version]](https://badge.fury.io/rb/unicode-confusable.svg)](https://badge.fury.io/rb/unicode-confusable) [![[ci]](https://github.com/janlelis/unicode-confusable/workflows/Test/badge.svg)](https://github.com/janlelis/unicode-confusable/actions?query=workflow%3ATest)
2
2
 
3
- Compares two strings if they are visually confusable as described in [Unicode® Technical Standard #39](http://www.unicode.org/reports/tr39/#Confusable_Detection): Both strings get transformed into a skeleton format before comparing them. The skeleton is generated by normalizing the string ([NFD](http://unicode.org/reports/tr15/#Norm_Forms)), replacing [confusable characters](ftp://ftp.unicode.org/Public/security/10.0.0/confusables.txt), and normalizing the string again.
3
+ Compares two strings if they are visually confusable as described in [Unicode® Technical Standard #39](https://www.unicode.org/reports/tr39/#Confusable_Detection): Both strings get transformed into a skeleton format before comparing them. The skeleton is generated by normalizing the string ([NFD](http://unicode.org/reports/tr15/#Norm_Forms)), replacing [confusable characters](https://unicode.org/Public/security/12.1.0/confusables.txt), and normalizing the string again.
4
4
 
5
- Unicode version: **11.0.0**
5
+ Unicode version: **14.0.0**\* (September 2021)
6
6
 
7
- Supported Rubies: **2.5**, **2.4**, **2.3**
7
+ \* The Unicode normalization [depends on your Ruby version](https://idiosyncratic-ruby.com/73-unicode-version-mapping.html)
8
8
 
9
- Old Rubies that might still work: **2.2**
9
+ Supported Rubies: **3.0**, **2.7**
10
+
11
+ Old Rubies which might still work: **2.6**, **2.5**, **2.4**, **2.3**, **2.2**
10
12
 
11
13
  ## Usage
12
14
 
@@ -29,11 +31,11 @@ Unicode::Confusable.confusable? "⁇", "??" # => true
29
31
  Unicode::Confusable.skeleton "ℜ𝘂ᖯʏ" # => "Ruby"
30
32
  ```
31
33
 
32
- **Please note:** The skeleton is an intermediate representation, not meant for any other use than testing confusability, [according to the standard](http://www.unicode.org/reports/tr39/#Confusable_Detection).
34
+ **Please note:** The skeleton is an intermediate representation, not meant for any other use than testing confusability, [according to the standard](https://www.unicode.org/reports/tr39/#Confusable_Detection).
33
35
 
34
36
  ### List
35
37
 
36
- List all confusables of specific character:
38
+ List all confusables of a specific character:
37
39
 
38
40
  ```ruby
39
41
  Unicode::Confusable.list("o", false)
@@ -61,5 +63,5 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
61
63
 
62
64
  ## MIT License
63
65
 
64
- - Copyright (C) 2016-2018 Jan Lelis <http://janlelis.com>. Released under the MIT license.
65
- - Unicode data: http://www.unicode.org/copyright.html#Exhibit1
66
+ - Copyright (C) 2016-2021 Jan Lelis <https://janlelis.com>. Released under the MIT license.
67
+ - Unicode data: https://www.unicode.org/copyright.html#Exhibit1
data/Rakefile CHANGED
@@ -32,6 +32,6 @@ end
32
32
 
33
33
  desc "#{gemspec.name} | Spec"
34
34
  task :spec do
35
- sh "for file in spec/*.rb; do ruby $file; done"
35
+ ruby "spec/unicode_confusable_spec.rb"
36
36
  end
37
37
  task default: :spec
Binary file
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Unicode
2
4
  module Confusable
3
- VERSION = "1.4.0".freeze
4
- UNICODE_VERSION = "11.0.0".freeze
5
- DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
6
- INDEX_FILENAME = (DATA_DIRECTORY + '/confusable.marshal.gz').freeze
5
+ VERSION = "1.8.0"
6
+ UNICODE_VERSION = "14.0.0"
7
+ DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
8
+ INDEX_FILENAME = (DATA_DIRECTORY + "/confusable.marshal.gz").freeze
7
9
  end
8
10
  end
9
11
 
@@ -0,0 +1,14 @@
1
+ # Classes
2
+ module Unicode
3
+ module Confusable
4
+ VERSION: String
5
+ UNICODE_VERSION: String
6
+ DATA_DIRECTORY: String
7
+ INDEX_FILENAME: String
8
+ INDEX: Hash
9
+
10
+ def self.confusable?: (String string1, String string2) -> bool
11
+ def self.skeleton: (String string) -> String
12
+ def self.list: (String char, ?bool partial_mapping_allowed) -> Array
13
+ end
14
+ end
@@ -6,9 +6,9 @@ Gem::Specification.new do |gem|
6
6
  gem.name = "unicode-confusable"
7
7
  gem.version = Unicode::Confusable::VERSION
8
8
  gem.summary = "Detect characters that look visually similar."
9
- gem.description = "[Unicode #{Unicode::Confusable::UNICODE_VERSION}] Compares two strings if they are visually confusable as described in Unicode® Technical Standard #39: Both strings get transformed into a skeleton format before comparing them. The skeleton is generated by normalizing the string, replacing confusable characters, and normalizing the string again."
9
+ gem.description = "[Unicode #{Unicode::Confusable::UNICODE_VERSION}] Compares two strings if they are visually confusable as described in Unicode® Technical Standard #39: Both strings get transformed into a skeleton format before comparing them. The skeleton is generated by normalizing the string, replacing confusable characters, and then normalizing the string again."
10
10
  gem.authors = ["Jan Lelis"]
11
- gem.email = ["mail@janlelis.de"]
11
+ gem.email = ["hi@ruby.consulting"]
12
12
  gem.homepage = "https://github.com/janlelis/unicode-confusable"
13
13
  gem.license = "MIT"
14
14
 
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.required_ruby_version = "~> 2.2"
20
+ gem.required_ruby_version = ">= 2.2"
21
21
  end
metadata CHANGED
@@ -1,27 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-confusable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-05 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: "[Unicode 11.0.0] Compares two strings if they are visually confusable
13
+ description: "[Unicode 14.0.0] Compares two strings if they are visually confusable
14
14
  as described in Unicode® Technical Standard #39: Both strings get transformed into
15
15
  a skeleton format before comparing them. The skeleton is generated by normalizing
16
- the string, replacing confusable characters, and normalizing the string again."
16
+ the string, replacing confusable characters, and then normalizing the string again."
17
17
  email:
18
- - mail@janlelis.de
18
+ - hi@ruby.consulting
19
19
  executables: []
20
20
  extensions: []
21
21
  extra_rdoc_files: []
22
22
  files:
23
23
  - ".gitignore"
24
- - ".travis.yml"
25
24
  - CHANGELOG.md
26
25
  - CODE_OF_CONDUCT.md
27
26
  - Gemfile
@@ -34,6 +33,7 @@ files:
34
33
  - lib/unicode/confusable/constants.rb
35
34
  - lib/unicode/confusable/index.rb
36
35
  - lib/unicode/confusable/string_ext.rb
36
+ - sig/unicode-confusable.rbs
37
37
  - spec/unicode_confusable_spec.rb
38
38
  - unicode-confusable.gemspec
39
39
  homepage: https://github.com/janlelis/unicode-confusable
@@ -46,7 +46,7 @@ require_paths:
46
46
  - lib
47
47
  required_ruby_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - "~>"
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '2.2'
52
52
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -55,8 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubyforge_project:
59
- rubygems_version: 2.7.6
58
+ rubygems_version: 3.2.3
60
59
  signing_key:
61
60
  specification_version: 4
62
61
  summary: Detect characters that look visually similar.
data/.travis.yml DELETED
@@ -1,18 +0,0 @@
1
- sudo: false
2
- language: ruby
3
-
4
- script: bundle exec ruby spec/unicode_confusable_spec.rb
5
-
6
- rvm:
7
- - 2.5.1
8
- - 2.4.4
9
- - 2.3.7
10
- - 2.2
11
- - ruby-head
12
- - jruby-head
13
- - jruby-9.1.16.0
14
-
15
- matrix:
16
- allow_failures:
17
- - rvm: 2.2
18
- - rvm: jruby-head