unicode-confusable 1.3.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5401e9a2c2540b4fe3941946e92df2f591494e87
4
- data.tar.gz: b9df7e729200391e5783ebc7cc7f3e306b61e321
2
+ SHA256:
3
+ metadata.gz: 16d2f6c3c2e193af770012c7ba5f293b2153112f693dec3cdead464048de2164
4
+ data.tar.gz: 58db50962af49521c0c9318edff3159b16b5e691d6c169a5e2eb85ae0dd95d96
5
5
  SHA512:
6
- metadata.gz: 5635c0eaf009994a20bd707750fb96d1b613fe06f051bdaad35e641e96f74508921d24b374a897b027243e9c37164c3877125c765d400ad41cbc7525833fe1d3
7
- data.tar.gz: 4c6109c63855ee2021af1571e952d0e95ab68db90008ee7eff6e0cbfee74ffb35156f0665f662aef8ade32c32a0361cec27e68f5a00586d8bba81b8d532dcf74
6
+ metadata.gz: 9a6d00a7ff4a25a2ebd6d2ed7322036004da192b39110d01bf11c891bd4601474757212b6ee2bb6b01def80cb5a44d4db0ca2bfe7b9622ff11ff237a10072366
7
+ data.tar.gz: 80934ded53c701daca4f83b1a9987dd3c27e9d85b2bd5994b7d1cfe39be4253438dd7d71e3d9e4da4c118323b38fbaaeaa238ffa1ebb937dfcb837d11449f3c9
@@ -4,13 +4,15 @@ language: ruby
4
4
  script: bundle exec ruby spec/unicode_confusable_spec.rb
5
5
 
6
6
  rvm:
7
- - 2.4.2
8
- - 2.3.5
7
+ - 2.5.1
8
+ - 2.4.4
9
+ - 2.3.7
9
10
  - 2.2
10
11
  - ruby-head
11
12
  - jruby-head
12
- - jruby-9.1.12.0
13
+ - jruby-9.1.16.0
13
14
 
14
15
  matrix:
15
16
  allow_failures:
17
+ - rvm: 2.2
16
18
  - rvm: jruby-head
@@ -1,5 +1,9 @@
1
1
  ## CHANGELOG
2
2
 
3
+ ### 1.3.1
4
+
5
+ * Use `Gem::Util` for `gunzip`, removes deprecation warning
6
+
3
7
  ### 1.3.0
4
8
 
5
9
  * Add Unicode::Confusable.list method which returns all confusables of given character
data/README.md CHANGED
@@ -4,10 +4,14 @@ Compares two strings if they are visually confusable as described in [Unicode®
4
4
 
5
5
  Unicode version: **10.0.0**
6
6
 
7
- Supported Rubies: **2.4**, **2.3**, **2.2**
7
+ Supported Rubies: **2.5**, **2.4**, **2.3**
8
+
9
+ Old Rubies that might still work: **2.2**
8
10
 
9
11
  ## Usage
10
12
 
13
+ ### Confusable?
14
+
11
15
  ```ruby
12
16
  require "unicode/confusable"
13
17
 
@@ -27,6 +31,22 @@ Unicode::Confusable.skeleton "ℜ𝘂ᖯʏ" # => "Ruby"
27
31
 
28
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).
29
33
 
34
+ ### List
35
+
36
+ List all confusables of specfic character:
37
+
38
+ ```ruby
39
+ Unicode::Confusable.list("o", false)
40
+ # => ["ం", "ಂ", "ം", "ං", "०", "੦", "૦", "௦", "౦", "೦", "൦", "๐", "໐", "၀", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "𞹤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ഠ", "ဝ", "𐓪", "𑣈", "𑣗", "𐐬"]
41
+ ```
42
+
43
+ If you omit the second parameter, it will also show confusables, where the given character is just a part of:
44
+
45
+ ```ruby
46
+ Unicode::Confusable.list("o")
47
+ # => ["⒪", "ꜵ", "℅", "ᴔ", "ꭁ", "ꭂ", "ﷲ", "№", "ం", "ಂ", "ം", "ං", "०", "੦", "૦", "௦", "౦", "೦", "൦", "๐", "໐", "၀", "٥", "۵", "o", "ℴ", "𝐨", "𝑜", "𝒐", "𝓸", "𝔬", "𝕠", "𝖔", "𝗈", "𝗼", "𝘰", "𝙤", "𝚘", "ᴏ", "ᴑ", "ꬽ", "ο", "𝛐", "𝜊", "𝝄", "𝝾", "𝞸", "σ", "𝛔", "𝜎", "𝝈", "𝞂", "𝞼", "ⲟ", "о", "ჿ", "օ", "ס", "ه", "𞸤", "𞹤", "𞺄", "ﻫ", "ﻬ", "ﻪ", "ﻩ", "ھ", "ﮬ", "ﮭ", "ﮫ", "ﮪ", "ہ", "ﮨ", "ﮩ", "ﮧ", "ﮦ", "ە", "ഠ", "ဝ", "𐓪", "𑣈", "𑣗", "𐐬", "ۿ", "ø", "ꬾ", "ɵ", "ꝋ", "ө", "ѳ", "ꮎ", "ꮻ", "ꭴ", "ﳙ", "ơ", "œ", "ɶ", "∞", "ꝏ", "ꚙ", "ﳗ", "ﱑ", "ﳘ", "ﱒ", "ﶓ", "ﶔ", "ﱓ", "ﱔ", "ൟ", "တ", "ꭣ", "ﲠ", "ﳢ", "ﲥ", "ﳤ", "ﷻ", "ﴱ", "ﳨ", "ﴲ", "ﳪ", "ﷺ", "ﷷ", "ﳍ", "ﳖ", "ﳯ", "ﳞ", "ﳱ", "ﳦ", "ﲛ", "ﳠ", "ﯭ", "ﯬ"]
48
+ ```
49
+
30
50
  ## No Advanced Detection
31
51
 
32
52
  TR 39 also describes mechanisms for a more exact recognition of confusables, also within the same string:
@@ -1,6 +1,6 @@
1
1
  module Unicode
2
2
  module Confusable
3
- VERSION = "1.3.0".freeze
3
+ VERSION = "1.3.1".freeze
4
4
  UNICODE_VERSION = "10.0.0".freeze
5
5
  DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + '/../../../data/').freeze
6
6
  INDEX_FILENAME = (DATA_DIRECTORY + '/confusable.marshal.gz').freeze
@@ -2,6 +2,6 @@ require_relative 'constants'
2
2
 
3
3
  module Unicode
4
4
  module Confusable
5
- INDEX = Marshal.load(Gem.gunzip(File.binread(INDEX_FILENAME)))
5
+ INDEX = Marshal.load(Gem::Util.gunzip(File.binread(INDEX_FILENAME)))
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode-confusable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
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-11-03 00:00:00.000000000 Z
11
+ date: 2018-04-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "[Unicode 10.0.0] Compares two strings if they are visually confusable
14
14
  as described in Unicode® Technical Standard #39: Both strings get transformed into
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  version: '0'
57
57
  requirements: []
58
58
  rubyforge_project:
59
- rubygems_version: 2.6.13
59
+ rubygems_version: 2.7.6
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Detect characters that look visually similar.