unicode-categories 1.3.0 → 1.7.0
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 +16 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -4
- data/MIT-LICENSE.txt +1 -1
- data/README.md +10 -8
- data/Rakefile +5 -1
- data/data/categories.marshal.gz +0 -0
- data/lib/unicode/categories/constants.rb +6 -4
- data/spec/unicode_categories_spec.rb +8 -2
- data/unicode-categories.gemspec +4 -4
- metadata +8 -10
- data/.travis.yml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55f2bf8572f74a9188b1969e1625472c9abf66a5d45376e2ba0c1d41cf3a5cf
|
4
|
+
data.tar.gz: 4fef80698d971cc0b7395853b1daf7fcb37fcf1e0a571f100747350205034596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a2341e8293ca64d44f8693c022190de8f3c1bf411b5a972a08fb6bcc0efe34d35189e1311232cfedcbdc860638bdb5216e446f58bbee6e59542318672aa146
|
7
|
+
data.tar.gz: 2d780af0d933a3a2c22b1460ef958571f80f699cbfdfeee5ade55b92acfa257048312af1018170eccc56cf2809e4a675abb6248312a474908bd0305df2583eb2
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,21 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
unicode-categories (1.
|
4
|
+
unicode-categories (1.6.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
9
|
+
io-console (0.5.4)
|
10
|
+
irb (1.2.1)
|
11
|
+
reline (>= 0.0.1)
|
12
|
+
minitest (5.14.0)
|
13
|
+
rake (13.0.1)
|
14
|
+
reline (0.1.2)
|
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-categories!
|
19
25
|
|
20
26
|
BUNDLED WITH
|
21
|
-
1.
|
27
|
+
2.1.2
|
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# Unicode::Categories [![[version]](https://badge.fury.io/rb/unicode-categories.svg)](
|
1
|
+
# Unicode::Categories [![[version]](https://badge.fury.io/rb/unicode-categories.svg)](https://badge.fury.io/rb/unicode-categories) [![[ci]](https://github.com/janlelis/unicode-categories/workflows/Test/badge.svg)](https://github.com/janlelis/unicode-categories/actions?query=workflow%3ATest)
|
2
2
|
|
3
|
-
Returns which [General Categories](https://en.wikipedia.org/wiki/Unicode_character_property#General_Category) a Unicode string
|
3
|
+
Returns a list which [General Categories](https://en.wikipedia.org/wiki/Unicode_character_property#General_Category) a Unicode string belongs to.
|
4
4
|
|
5
|
-
Unicode version: **
|
5
|
+
Unicode version: **14.0.0** (September 2021)
|
6
6
|
|
7
|
-
Supported Rubies: **
|
7
|
+
Supported Rubies: **3.0**, **2.7**
|
8
8
|
|
9
|
-
Old Rubies that might still work: **2.2**, **2.1**, **2.0**
|
9
|
+
Old Rubies that might still work: **2.6**, **2.5**, **2.4**, **2.3**, **2.2**, **2.1**, **2.0**
|
10
10
|
|
11
11
|
## Gemfile
|
12
12
|
|
@@ -37,12 +37,14 @@ The list of categories is always sorted alphabetically.
|
|
37
37
|
|
38
38
|
### Regex Matching
|
39
39
|
|
40
|
-
If you have a string and want to match a substring/character from a specific Unicode block, you actually won't need this gem. Instead, you can use the [Regexp Unicode Property Syntax `\p{}`](
|
40
|
+
If you have a string and want to match a substring/character from a specific Unicode block, you actually won't need this gem. Instead, you can use the [Regexp Unicode Property Syntax `\p{}`](https://ruby-doc.org/core/Regexp.html#class-Regexp-label-Character+Properties):
|
41
41
|
|
42
42
|
```ruby
|
43
43
|
"Find decimal numbers (like 2 or 3) within a string".scan(/\p{Nd}+/) # => ["2", "3"]
|
44
44
|
```
|
45
45
|
|
46
|
+
See [Idiosyncratic Ruby: Proper Unicoding](https://idiosyncratic-ruby.com/41-proper-unicoding.html) for more info.
|
47
|
+
|
46
48
|
### List of General Categories
|
47
49
|
|
48
50
|
You can retrieve a list of all General Categories like this:
|
@@ -93,6 +95,6 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
93
95
|
|
94
96
|
## MIT License
|
95
97
|
|
96
|
-
- Copyright (C) 2016-
|
97
|
-
- Unicode data:
|
98
|
+
- Copyright (C) 2016-2021 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
99
|
+
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
98
100
|
|
data/Rakefile
CHANGED
@@ -32,6 +32,10 @@ end
|
|
32
32
|
|
33
33
|
desc "#{gemspec.name} | Spec"
|
34
34
|
task :spec do
|
35
|
-
|
35
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
|
36
|
+
sh "for %f in (spec/\*.rb) do ruby spec/%f"
|
37
|
+
else
|
38
|
+
sh "for file in spec/*.rb; do ruby $file; done"
|
39
|
+
end
|
36
40
|
end
|
37
41
|
task default: :spec
|
data/data/categories.marshal.gz
CHANGED
Binary file
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Unicode
|
2
4
|
module Categories
|
3
|
-
VERSION = "1.
|
4
|
-
UNICODE_VERSION = "
|
5
|
-
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) +
|
6
|
-
INDEX_FILENAME = (DATA_DIRECTORY +
|
5
|
+
VERSION = "1.7.0"
|
6
|
+
UNICODE_VERSION = "14.0.0"
|
7
|
+
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
|
8
|
+
INDEX_FILENAME = (DATA_DIRECTORY + "/categories.marshal.gz").freeze
|
7
9
|
end
|
8
10
|
end
|
9
11
|
|
@@ -23,8 +23,14 @@ describe Unicode::Categories do
|
|
23
23
|
|
24
24
|
it "will call .category for every character" do
|
25
25
|
mocked_method = MiniTest::Mock.new
|
26
|
-
|
27
|
-
|
26
|
+
if RUBY_VERSION >= "2.7"
|
27
|
+
mocked_method.expect :call, "first category", ["A"]
|
28
|
+
mocked_method.expect :call, "second category", ["2"]
|
29
|
+
else
|
30
|
+
mocked_method.expect :call, "first category", ["A", {}]
|
31
|
+
mocked_method.expect :call, "second category", ["2", {}]
|
32
|
+
end
|
33
|
+
|
28
34
|
Unicode::Categories.stub :category, mocked_method do
|
29
35
|
Unicode::Categories.of("A2")
|
30
36
|
end
|
data/unicode-categories.gemspec
CHANGED
@@ -5,10 +5,10 @@ require File.dirname(__FILE__) + "/lib/unicode/categories/constants"
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "unicode-categories"
|
7
7
|
gem.version = Unicode::Categories::VERSION
|
8
|
-
gem.summary = "Determine the Unicode General Categories of a string
|
9
|
-
gem.description = "[Unicode #{Unicode::Categories::UNICODE_VERSION}] Determine which Unicode General Categories a string belongs to
|
8
|
+
gem.summary = "Determine the Unicode General Categories of a string"
|
9
|
+
gem.description = "[Unicode #{Unicode::Categories::UNICODE_VERSION}] Determine which Unicode \"General Categories\" a string belongs to"
|
10
10
|
gem.authors = ["Jan Lelis"]
|
11
|
-
gem.email = ["
|
11
|
+
gem.email = ["hi@ruby.consulting"]
|
12
12
|
gem.homepage = "https://github.com/janlelis/unicode-categories"
|
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 = "
|
20
|
+
gem.required_ruby_version = ">= 2.0"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-categories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.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:
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
belongs to
|
13
|
+
description: '[Unicode 14.0.0] Determine which Unicode "General Categories" a string
|
14
|
+
belongs to'
|
15
15
|
email:
|
16
|
-
-
|
16
|
+
- hi@ruby.consulting
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- ".gitignore"
|
22
|
-
- ".travis.yml"
|
23
22
|
- CHANGELOG.md
|
24
23
|
- CODE_OF_CONDUCT.md
|
25
24
|
- Gemfile
|
@@ -44,7 +43,7 @@ require_paths:
|
|
44
43
|
- lib
|
45
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
46
45
|
requirements:
|
47
|
-
- - "
|
46
|
+
- - ">="
|
48
47
|
- !ruby/object:Gem::Version
|
49
48
|
version: '2.0'
|
50
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -53,10 +52,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
52
|
- !ruby/object:Gem::Version
|
54
53
|
version: '0'
|
55
54
|
requirements: []
|
56
|
-
|
57
|
-
rubygems_version: 2.7.6
|
55
|
+
rubygems_version: 3.2.3
|
58
56
|
signing_key:
|
59
57
|
specification_version: 4
|
60
|
-
summary: Determine the Unicode General Categories of a string
|
58
|
+
summary: Determine the Unicode General Categories of a string
|
61
59
|
test_files:
|
62
60
|
- spec/unicode_categories_spec.rb
|
data/.travis.yml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- ruby-head
|
6
|
-
- 2.5.1
|
7
|
-
- 2.4.4
|
8
|
-
- 2.3.7
|
9
|
-
- 2.2
|
10
|
-
- 2.1
|
11
|
-
- 2.0
|
12
|
-
- jruby-head
|
13
|
-
- jruby-9.1.16.0
|
14
|
-
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: jruby-head
|
18
|
-
- rvm: ruby-head
|
19
|
-
- rvm: 2.2
|
20
|
-
- rvm: 2.1
|
21
|
-
- rvm: 2.0
|
22
|
-
# fast_finish: true
|