unicode-categories 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -10
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/MIT-LICENSE.txt +1 -1
- data/README.md +6 -6
- data/data/categories.marshal.gz +0 -0
- data/lib/unicode/categories/constants.rb +2 -2
- data/spec/unicode_categories_spec.rb +8 -2
- data/unicode-categories.gemspec +4 -4
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90b192327f89de47beae7a12617550a4a173ec52c6ae036e1fd2767058aff48c
|
4
|
+
data.tar.gz: d51614840be17076dfe46d3efca55a8fd8193cbc78622a6eec320ed09cb38360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b7f45f7b382e4eeb89be2448737b7a455477d957e6eb5cec319452938094a21e9df35edfde9cc19aace44d10bc52be5fd4732db8471ab7d5710b3f6d6ca5950
|
7
|
+
data.tar.gz: 13d0fd21af295f51be54f1660ea4445d234d192e3440366e421835aba19f0474fd8e79798af4deef4cf9acd49be181d1ee6978d8d4137c958064919f021c7c82
|
data/.travis.yml
CHANGED
@@ -2,21 +2,19 @@ sudo: false
|
|
2
2
|
language: ruby
|
3
3
|
|
4
4
|
rvm:
|
5
|
-
-
|
5
|
+
- 2.7
|
6
6
|
- 2.6
|
7
7
|
- 2.5
|
8
8
|
- 2.4
|
9
9
|
- 2.3
|
10
|
-
-
|
11
|
-
- 2.
|
12
|
-
-
|
13
|
-
- jruby-head
|
14
|
-
- jruby-9.2.7.0
|
10
|
+
- ruby-head
|
11
|
+
- jruby-9.2.9.0
|
12
|
+
- truffleruby
|
15
13
|
|
16
14
|
matrix:
|
17
15
|
allow_failures:
|
18
|
-
- rvm: jruby-head
|
19
16
|
- rvm: 2.3
|
20
|
-
- rvm:
|
21
|
-
- rvm: 2.
|
22
|
-
- rvm:
|
17
|
+
- rvm: ruby-head
|
18
|
+
- rvm: jruby-2.9.2.0
|
19
|
+
- rvm: truffleruby
|
20
|
+
# fast_finish: true
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/MIT-LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Unicode::Categories [![[version]](https://badge.fury.io/rb/unicode-categories.svg)](https://badge.fury.io/rb/unicode-categories) [![[travis]](https://travis-ci.org/janlelis/unicode-categories.png)](https://travis-ci.org/janlelis/unicode-categories)
|
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: **13.0.0** (March 2020)
|
6
6
|
|
7
|
-
Supported Rubies: **2.6**, **2.5**, **2.4**
|
7
|
+
Supported Rubies: **2.7**, **2.6**, **2.5**, **2.4**
|
8
8
|
|
9
9
|
Old Rubies that might still work: **2.3**, **2.2**, **2.1**, **2.0**
|
10
10
|
|
@@ -37,7 +37,7 @@ 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"]
|
@@ -95,6 +95,6 @@ See [unicode-x](https://github.com/janlelis/unicode-x) for more Unicode related
|
|
95
95
|
|
96
96
|
## MIT License
|
97
97
|
|
98
|
-
- Copyright (C) 2016-
|
99
|
-
- Unicode data:
|
98
|
+
- Copyright (C) 2016-2020 Jan Lelis <https://janlelis.com>. Released under the MIT license.
|
99
|
+
- Unicode data: https://www.unicode.org/copyright.html#Exhibit1
|
100
100
|
|
data/data/categories.marshal.gz
CHANGED
Binary file
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
module Unicode
|
4
4
|
module Categories
|
5
|
-
VERSION = "1.
|
6
|
-
UNICODE_VERSION = "
|
5
|
+
VERSION = "1.6.0"
|
6
|
+
UNICODE_VERSION = "13.0.0"
|
7
7
|
DATA_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../../../data/").freeze
|
8
8
|
INDEX_FILENAME = (DATA_DIRECTORY + "/categories.marshal.gz").freeze
|
9
9
|
end
|
@@ -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,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-categories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.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: 2020-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
belongs to
|
13
|
+
description: '[Unicode 13.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: []
|
@@ -44,7 +44,7 @@ require_paths:
|
|
44
44
|
- lib
|
45
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '2.0'
|
50
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -53,9 +53,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
56
|
+
rubygems_version: 3.1.2
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
|
-
summary: Determine the Unicode General Categories of a string
|
59
|
+
summary: Determine the Unicode General Categories of a string
|
60
60
|
test_files:
|
61
61
|
- spec/unicode_categories_spec.rb
|