character_set 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +0 -3
- data/CHANGELOG.md +5 -0
- data/README.md +3 -3
- data/Rakefile +40 -20
- data/character_set.gemspec +3 -4
- data/ext/character_set/unicode_casefold_table.h +10 -2
- data/lib/character_set/version.rb +1 -1
- metadata +26 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 434323b3b99246a17ea5e062afd87d3edc3c09927b2231b4409b295ff63c7d6c
|
4
|
+
data.tar.gz: 174c6dc751b03e49cf87045fad9a48100460244b7d7e25deef27066bd4aef92c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9fa059ea3171209af537f0bd7636e3a65b962f30029ca399fe2fa0bd6168dd692b7bc5fb1014590a830b2e9aede9c26ae00ae8fe4a2eae4a86cf95e208b507d
|
7
|
+
data.tar.gz: 692f4596b6adc9b44879b69fb82e55dc90d107156ecabb96c14ea91b4dc0c7dc706724b42093d0ef762cdac697f05ef855c5f462451015e1d06022ab06bc1c8d
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.2.0] - 2019-04-02
|
8
|
+
|
9
|
+
### Added
|
10
|
+
- added latest Unicode casefold data (for `#case_insensitive`)
|
11
|
+
|
7
12
|
## [1.1.2] - 2018-09-25
|
8
13
|
|
9
14
|
### Fixed
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# CharacterSet
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/character_set.svg)](http://badge.fury.io/rb/character_set)
|
4
|
-
[![Build Status](https://travis-ci.org/
|
4
|
+
[![Build Status](https://travis-ci.org/jaynetics/character_set.svg?branch=master)](https://travis-ci.org/jaynetics/character_set)
|
5
5
|
|
6
6
|
A gem to build, read, write and compare sets of Unicode codepoints.
|
7
7
|
|
@@ -9,7 +9,7 @@ Many parts can be used independently, e.g.:
|
|
9
9
|
- `CharacterSet::Character`
|
10
10
|
- `CharacterSet::Parser`
|
11
11
|
- `CharacterSet::Writer`
|
12
|
-
- [`RangeCompressor`](https://github.com/
|
12
|
+
- [`RangeCompressor`](https://github.com/jaynetics/range_compressor)
|
13
13
|
|
14
14
|
## Usage
|
15
15
|
|
@@ -37,7 +37,7 @@ CharacterSet.parse('[a-c]')
|
|
37
37
|
CharacterSet.parse('\U00000061-\U00000063')
|
38
38
|
```
|
39
39
|
|
40
|
-
If the gems [`regexp_parser`](https://github.com/ammar/regexp_parser) and [`regexp_property_values`](https://github.com/
|
40
|
+
If the gems [`regexp_parser`](https://github.com/ammar/regexp_parser) and [`regexp_property_values`](https://github.com/jaynetics/regexp_property_values) are installed, `::of_regexp` and `::of_property` can also be used. `::of_regexp` can handle intersections, negations, and set nesting.
|
41
41
|
|
42
42
|
```ruby
|
43
43
|
CharacterSet.of_property('Thai') # => #<CharacterSet (size: 86)>
|
data/Rakefile
CHANGED
@@ -35,43 +35,62 @@ task :sync_ruby_spec do
|
|
35
35
|
'CharacterSet' => './spec/ruby-spec/library/character_set',
|
36
36
|
'CharacterSet::Pure' => './spec/ruby-spec/library/character_set_pure',
|
37
37
|
}
|
38
|
+
|
39
|
+
# download fresh specs from ruby/spec repository
|
38
40
|
variants.each do |_, dir|
|
39
41
|
FileUtils.rm_rf(dir) if File.exist?(dir)
|
40
42
|
`svn export https://github.com/ruby/spec/trunk/library/set/sortedset #{dir}`
|
41
43
|
end
|
42
44
|
|
45
|
+
# make copies for each CharacterSet variant
|
43
46
|
base = variants.first[1]
|
44
47
|
variants.each_value { |dir| FileUtils.copy_entry(base, dir) unless dir == base }
|
45
48
|
|
46
|
-
|
49
|
+
# adapt specs to work with CharacterSet
|
50
|
+
variants.each do |class_name, dir|
|
47
51
|
Dir["#{dir}/**/*.rb"].each do |spec|
|
48
|
-
#
|
49
|
-
if spec =~ %r{/(flatten|initialize|pretty_print)}
|
52
|
+
# ignore some tests that do not apply or are covered otherwise
|
53
|
+
if spec =~ %r{/(classify|divide|flatten|initialize|pretty_print)}
|
50
54
|
File.delete(spec)
|
51
55
|
next
|
52
56
|
end
|
53
57
|
|
54
|
-
# some examples w. Strings must be adapted, "mspec" made rspec-compatible,
|
55
|
-
# and `i` added to shared example names or they'll override each other
|
56
58
|
adapted_content =
|
57
|
-
File
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
59
|
+
File.read(spec).
|
60
|
+
# adapt class name
|
61
|
+
gsub('SortedSet', (spec['/shared/'] ? 'variant' : class_name)).
|
62
|
+
gsub(/(it_behaves_like :[^,\n]+), (:[^,\n]+)/, "\\1, #{class_name}, \\2").
|
63
|
+
# get shared specs from a single shared dir at the parent level
|
64
|
+
gsub(/(require_relative ['"])(shared\/)/, '\1../\2').
|
65
|
+
# make 'mspec' syntax rspec-compatible
|
66
|
+
gsub(/describe (.*), shared.*$/, 'shared_examples \1 do |variant, method|').
|
67
|
+
gsub(/be_(false|true)/, 'be \1').
|
68
|
+
gsub('stub!', 'stub').
|
69
|
+
gsub('mock', 'double').
|
70
|
+
gsub('@method', 'method').
|
71
|
+
# remove unneeded requires
|
72
|
+
gsub(/require 'set'\n/, '').
|
73
|
+
gsub(/require.*spec_helper.*\n/, '').
|
74
|
+
gsub(/\A\n+/, '').
|
75
|
+
# make examples use Integers/codepoints
|
76
|
+
gsub(/1\.0|"cat"|"dog"|"hello"|"test"/, '0').
|
77
|
+
gsub('"one"', '1').
|
78
|
+
gsub('"two"', '2').
|
79
|
+
gsub('"three"', '3').
|
80
|
+
gsub('"four"', '4').
|
81
|
+
gsub('"five"', '5').
|
82
|
+
gsub(/x.(size|length) == 3/, 'x != 3').
|
83
|
+
gsub(/x.(size|length) != 3/, 'x == 3').
|
84
|
+
gsub(/(add)\(\d\)(\.to_a \}.should raise)/, '\1(:foo)\2')
|
71
85
|
|
72
86
|
File.open(spec, 'w') { |f| f.puts adapted_content }
|
73
87
|
end
|
74
88
|
end
|
89
|
+
|
90
|
+
# keep only one copy of the shared specs, at the parent level
|
91
|
+
FileUtils.rm_rf(base + '/../shared')
|
92
|
+
FileUtils.mv(base + '/shared', base + '/../')
|
93
|
+
variants.each_value { |dir| FileUtils.rm_rf(dir + '/shared') }
|
75
94
|
end
|
76
95
|
|
77
96
|
desc 'Download unicode casefold data and write new C header file'
|
@@ -89,7 +108,8 @@ task :sync_casefold_data do
|
|
89
108
|
|
90
109
|
File.open(dst_path, 'w') do |f|
|
91
110
|
f.puts <<-C
|
92
|
-
// THIS FILE IS GENERATED BY $ rake sync_casefold_data - DO NOT EDIT
|
111
|
+
// THIS FILE IS GENERATED BY $ rake sync_casefold_data - DO NOT EDIT
|
112
|
+
// -*-C-*-
|
93
113
|
|
94
114
|
typedef struct casefold_mapping {
|
95
115
|
unsigned long from;
|
data/character_set.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ['janosch84@gmail.com']
|
11
11
|
|
12
12
|
s.summary = 'Build, read, write and compare sets of Unicode codepoints.'
|
13
|
-
s.homepage = 'https://github.com/
|
13
|
+
s.homepage = 'https://github.com/jaynetics/character_set'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
16
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -23,11 +23,10 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.required_ruby_version = '>= 2.1.0'
|
24
24
|
|
25
25
|
s.add_development_dependency 'benchmark-ips', '~> 2.7'
|
26
|
-
s.add_development_dependency 'bundler', '~> 1.16'
|
27
26
|
s.add_development_dependency 'rake', '~> 12.0'
|
28
27
|
s.add_development_dependency 'rake-compiler', '~> 1.0'
|
29
28
|
s.add_development_dependency 'range_compressor', '~> 1.0'
|
30
|
-
s.add_development_dependency 'regexp_parser', '~> 1.
|
31
|
-
s.add_development_dependency 'regexp_property_values', '~> 0.3.
|
29
|
+
s.add_development_dependency 'regexp_parser', '~> 1.3'
|
30
|
+
s.add_development_dependency 'regexp_property_values', '~> 0.3.5'
|
32
31
|
s.add_development_dependency 'rspec', '~> 3.8'
|
33
32
|
end
|
@@ -1,11 +1,12 @@
|
|
1
|
-
// THIS FILE IS GENERATED BY $ rake sync_casefold_data - DO NOT EDIT
|
1
|
+
// THIS FILE IS GENERATED BY $ rake sync_casefold_data - DO NOT EDIT
|
2
|
+
// -*-C-*-
|
2
3
|
|
3
4
|
typedef struct casefold_mapping {
|
4
5
|
unsigned long from;
|
5
6
|
unsigned long to;
|
6
7
|
} casefold_mapping;
|
7
8
|
|
8
|
-
#define CASEFOLD_COUNT
|
9
|
+
#define CASEFOLD_COUNT 1383
|
9
10
|
|
10
11
|
static const casefold_mapping unicode_casefold_table[CASEFOLD_COUNT] = {
|
11
12
|
{0x0041,0x0061},
|
@@ -1278,6 +1279,13 @@ static const casefold_mapping unicode_casefold_table[CASEFOLD_COUNT] = {
|
|
1278
1279
|
{0xA7B4,0xA7B5},
|
1279
1280
|
{0xA7B6,0xA7B7},
|
1280
1281
|
{0xA7B8,0xA7B9},
|
1282
|
+
{0xA7BA,0xA7BB},
|
1283
|
+
{0xA7BC,0xA7BD},
|
1284
|
+
{0xA7BE,0xA7BF},
|
1285
|
+
{0xA7C2,0xA7C3},
|
1286
|
+
{0xA7C4,0xA794},
|
1287
|
+
{0xA7C5,0x0282},
|
1288
|
+
{0xA7C6,0x1D8E},
|
1281
1289
|
{0xAB70,0x13A0},
|
1282
1290
|
{0xAB71,0x13A1},
|
1283
1291
|
{0xAB72,0x13A2},
|
metadata
CHANGED
@@ -1,128 +1,114 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: character_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janosch Müller
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: benchmark-ips
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
19
|
version: '2.7'
|
19
|
-
name: benchmark-ips
|
20
|
-
prerelease: false
|
21
20
|
type: :development
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - "~>"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '1.16'
|
33
|
-
name: bundler
|
34
21
|
prerelease: false
|
35
|
-
type: :development
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
24
|
- - "~>"
|
39
25
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
26
|
+
version: '2.7'
|
41
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
42
29
|
requirement: !ruby/object:Gem::Requirement
|
43
30
|
requirements:
|
44
31
|
- - "~>"
|
45
32
|
- !ruby/object:Gem::Version
|
46
33
|
version: '12.0'
|
47
|
-
name: rake
|
48
|
-
prerelease: false
|
49
34
|
type: :development
|
35
|
+
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
38
|
- - "~>"
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '12.0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake-compiler
|
56
43
|
requirement: !ruby/object:Gem::Requirement
|
57
44
|
requirements:
|
58
45
|
- - "~>"
|
59
46
|
- !ruby/object:Gem::Version
|
60
47
|
version: '1.0'
|
61
|
-
name: rake-compiler
|
62
|
-
prerelease: false
|
63
48
|
type: :development
|
49
|
+
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - "~>"
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '1.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: range_compressor
|
70
57
|
requirement: !ruby/object:Gem::Requirement
|
71
58
|
requirements:
|
72
59
|
- - "~>"
|
73
60
|
- !ruby/object:Gem::Version
|
74
61
|
version: '1.0'
|
75
|
-
name: range_compressor
|
76
|
-
prerelease: false
|
77
62
|
type: :development
|
63
|
+
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '1.0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
name: regexp_parser
|
84
71
|
requirement: !ruby/object:Gem::Requirement
|
85
72
|
requirements:
|
86
73
|
- - "~>"
|
87
74
|
- !ruby/object:Gem::Version
|
88
|
-
version: '1.
|
89
|
-
name: regexp_parser
|
90
|
-
prerelease: false
|
75
|
+
version: '1.3'
|
91
76
|
type: :development
|
77
|
+
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1.
|
82
|
+
version: '1.3'
|
97
83
|
- !ruby/object:Gem::Dependency
|
84
|
+
name: regexp_property_values
|
98
85
|
requirement: !ruby/object:Gem::Requirement
|
99
86
|
requirements:
|
100
87
|
- - "~>"
|
101
88
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.3.
|
103
|
-
name: regexp_property_values
|
104
|
-
prerelease: false
|
89
|
+
version: 0.3.5
|
105
90
|
type: :development
|
91
|
+
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.3.
|
96
|
+
version: 0.3.5
|
111
97
|
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
100
|
requirements:
|
114
101
|
- - "~>"
|
115
102
|
- !ruby/object:Gem::Version
|
116
103
|
version: '3.8'
|
117
|
-
name: rspec
|
118
|
-
prerelease: false
|
119
104
|
type: :development
|
105
|
+
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
110
|
version: '3.8'
|
125
|
-
description:
|
111
|
+
description:
|
126
112
|
email:
|
127
113
|
- janosch84@gmail.com
|
128
114
|
executables: []
|
@@ -167,11 +153,11 @@ files:
|
|
167
153
|
- lib/character_set/shared_methods.rb
|
168
154
|
- lib/character_set/version.rb
|
169
155
|
- lib/character_set/writer.rb
|
170
|
-
homepage: https://github.com/
|
156
|
+
homepage: https://github.com/jaynetics/character_set
|
171
157
|
licenses:
|
172
158
|
- MIT
|
173
159
|
metadata: {}
|
174
|
-
post_install_message:
|
160
|
+
post_install_message:
|
175
161
|
rdoc_options: []
|
176
162
|
require_paths:
|
177
163
|
- lib
|
@@ -186,9 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
172
|
- !ruby/object:Gem::Version
|
187
173
|
version: '0'
|
188
174
|
requirements: []
|
189
|
-
|
190
|
-
|
191
|
-
signing_key:
|
175
|
+
rubygems_version: 3.0.3
|
176
|
+
signing_key:
|
192
177
|
specification_version: 4
|
193
178
|
summary: Build, read, write and compare sets of Unicode codepoints.
|
194
179
|
test_files: []
|