regexp_property_values 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +22 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +4 -1
- data/lib/aliases +8 -0
- data/lib/regexp_property_values/updater.rb +24 -10
- data/lib/regexp_property_values/version.rb +1 -1
- data/lib/regexp_property_values.rb +2 -2
- data/lib/values +13 -0
- data/regexp_property_values.gemspec +1 -1
- metadata +9 -9
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1e8246c2e32e3bd432d5d5415f3ad536636885aedc3c40f70e6a0d0c7a5c43
|
4
|
+
data.tar.gz: a5cdc40a2e706eec1eb196f631da9600a348c2f43ed6318963d921d27577fdd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2fddabf090ae57f51aabdc531f3fc172aa23b12045a0efcaacde47ebadeb128d6d5a681d4d87338d5ce27f866236792892209e0a000e63dfb5203a1137f80e
|
7
|
+
data.tar.gz: 92cd5331a646f6f03cfbc2c51cb917927bf54df147f6e93e7cbf7a83f998bffe2bccbc1d8a9cc2677c8b9a6fdaec04f18e3b5b134795d7ce6f789295c607513b
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: tests
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby: [ '2.3', '3.0', 'ruby-head', 'jruby-head' ]
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: ${{ matrix.ruby }}
|
19
|
+
- name: Install dependencies
|
20
|
+
run: bundle install --jobs 4
|
21
|
+
- name: Test with Rake
|
22
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ 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.1.0] - 2021-12-05
|
8
|
+
|
9
|
+
### Added
|
10
|
+
- added new properties from Ruby `3.1.0-dev` to output of `::all`, `::all_for_current_ruby`
|
11
|
+
- added options to run `::update` with custom ucd/emoji source paths
|
12
|
+
|
7
13
|
## [1.0.0] - 2019-06-16
|
8
14
|
|
9
15
|
### Changed
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# RegexpPropertyValues
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/regexp_property_values.svg)](http://badge.fury.io/rb/regexp_property_values)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/jaynetics/regexp_property_values/workflows/tests/badge.svg)](https://github.com/jaynetics/regexp_property_values/actions)
|
5
5
|
|
6
6
|
This small library lets you see which property values are supported by the regular expression engine of the Ruby version you are running and directly reads out their codepoint ranges from there.
|
7
7
|
|
@@ -34,6 +34,8 @@ PV['foobar'].supported_by_current_ruby? # => false
|
|
34
34
|
PV['AHex'].matched_characters # => %w[0 1 2 3 4 5 6 7 8 9 A B C ...]
|
35
35
|
PV['AHex'].matched_codepoints # => [48, 49, 50, ...]
|
36
36
|
PV['AHex'].matched_ranges # => [48..57, 65..70, 97..102]
|
37
|
+
|
38
|
+
PV['foobar'].matched_ranges # => RegexpPropertyValues::Error
|
37
39
|
```
|
38
40
|
|
39
41
|
If [`character_set`](https://github.com/jaynetics/character_set) is installed, you can also do this:
|
@@ -49,5 +51,6 @@ PV['AHex'].character_set # => #<CharacterSet: {48, 49...} (size: 22)>
|
|
49
51
|
PV.alias_hash # => { <Value name='M'> => <Value name='Mark'>, ... }
|
50
52
|
|
51
53
|
# download a list of possible properties for the running Ruby version
|
54
|
+
# (only used for .all and .alias_hash, not needed for prop lookup via .[])
|
52
55
|
PV.update
|
53
56
|
```
|
data/lib/aliases
CHANGED
@@ -30,6 +30,7 @@ Cari;Carian
|
|
30
30
|
Cc;Control
|
31
31
|
Cf;Format
|
32
32
|
Cher;Cherokee
|
33
|
+
Chrs;Chorasmian
|
33
34
|
Cn;Unassigned
|
34
35
|
Co;Private_Use
|
35
36
|
Combining_Mark;Mark
|
@@ -41,9 +42,14 @@ DI;Default_Ignorable_Code_Point
|
|
41
42
|
Dep;Deprecated
|
42
43
|
Deva;Devanagari
|
43
44
|
Dia;Diacritic
|
45
|
+
Diak;Dives_Akuru
|
44
46
|
Dogr;Dogra
|
45
47
|
Dsrt;Deseret
|
46
48
|
Dupl;Duployan
|
49
|
+
EBase;Emoji_Modifier_Base
|
50
|
+
EComp;Emoji_Component
|
51
|
+
EMod;Emoji_Modifier
|
52
|
+
EPres;Emoji_Presentation
|
47
53
|
Egyp;Egyptian_Hieroglyphs
|
48
54
|
Elba;Elbasan
|
49
55
|
Elym;Elymaic
|
@@ -85,6 +91,7 @@ Kana;Katakana
|
|
85
91
|
Khar;Kharoshthi
|
86
92
|
Khmr;Khmer
|
87
93
|
Khoj;Khojki
|
94
|
+
Kits;Khitan_Small_Script
|
88
95
|
Knda;Kannada
|
89
96
|
Kthi;Kaithi
|
90
97
|
L;Letter
|
@@ -222,6 +229,7 @@ XIDC;XID_Continue
|
|
222
229
|
XIDS;XID_Start
|
223
230
|
Xpeo;Old_Persian
|
224
231
|
Xsux;Cuneiform
|
232
|
+
Yezi;Yezidi
|
225
233
|
Yiii;Yi
|
226
234
|
Z;Separator
|
227
235
|
Zanb;Zanabazar_Square
|
@@ -5,7 +5,7 @@ module RegexpPropertyValues
|
|
5
5
|
require 'fileutils'
|
6
6
|
require 'set'
|
7
7
|
|
8
|
-
BASE_URL = 'http://www.unicode.org/Public
|
8
|
+
BASE_URL = 'http://www.unicode.org/Public'
|
9
9
|
|
10
10
|
UCD_FILES = %w[
|
11
11
|
Blocks.txt
|
@@ -23,9 +23,9 @@ module RegexpPropertyValues
|
|
23
23
|
|
24
24
|
TMP_DIR = File.join(__dir__, 'tmp_ucd')
|
25
25
|
|
26
|
-
def call
|
26
|
+
def call(ucd_path: nil, emoji_path: nil)
|
27
27
|
prepare_tmp_dir
|
28
|
-
download_ucd_files
|
28
|
+
download_ucd_files(ucd_path: ucd_path, emoji_path: emoji_path)
|
29
29
|
write_values
|
30
30
|
write_aliases
|
31
31
|
remove_tmp_dir
|
@@ -37,17 +37,31 @@ module RegexpPropertyValues
|
|
37
37
|
FileUtils.mkdir(TMP_DIR)
|
38
38
|
end
|
39
39
|
|
40
|
-
def download_ucd_files
|
40
|
+
def download_ucd_files(ucd_path: nil, emoji_path: nil)
|
41
41
|
unicode_version = RbConfig::CONFIG.fetch('UNICODE_VERSION')
|
42
42
|
emoji_version = RbConfig::CONFIG.fetch('UNICODE_EMOJI_VERSION')
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
|
44
|
+
ucd_path ||= ENV['RPV_UCD_PATH']
|
45
|
+
emoji_path ||= ENV['RPV_EMOJI_PATH']
|
46
|
+
|
47
|
+
if ucd_path.nil? && emoji_path.nil?
|
48
|
+
puts <<-EOS.gsub(/\n */, ' ')
|
49
|
+
This try will load ucd and emoji data for the CURRENT RUBY (
|
50
|
+
(#{RUBY_VERSION} - ucd #{unicode_version}, emoji #{emoji_version}).
|
51
|
+
Run this on the latest Ruby version you want to support.
|
52
|
+
Unicode directory structure changes sometimes, so you might need to
|
53
|
+
pass the right path(s) as keyword args or ENV vars. Continue? [y/n]'
|
54
|
+
EOS
|
55
|
+
|
56
|
+
return puts 'download skipped.' unless $stdin.gets =~ /^y/i
|
57
|
+
end
|
58
|
+
|
59
|
+
ucd_path ||= "#{BASE_URL}/#{unicode_version}/ucd"
|
60
|
+
emoji_path ||= "#{BASE_URL}/emoji/#{emoji_version}"
|
47
61
|
|
48
62
|
Dir.chdir(TMP_DIR) do
|
49
|
-
UCD_FILES.each { |f| `wget #{
|
50
|
-
EMOJI_FILES.each { |f| `wget #{
|
63
|
+
UCD_FILES.each { |f| `wget #{ucd_path}/#{f}` }
|
64
|
+
EMOJI_FILES.each { |f| `wget #{emoji_path}/#{f}` }
|
51
65
|
end
|
52
66
|
end
|
53
67
|
|
data/lib/values
CHANGED
@@ -6,6 +6,7 @@ Age=10.0
|
|
6
6
|
Age=11.0
|
7
7
|
Age=12.0
|
8
8
|
Age=12.1
|
9
|
+
Age=13.0
|
9
10
|
Age=2.0
|
10
11
|
Age=2.1
|
11
12
|
Age=3.0
|
@@ -60,6 +61,7 @@ Changes_When_Lowercased
|
|
60
61
|
Changes_When_Titlecased
|
61
62
|
Changes_When_Uppercased
|
62
63
|
Cherokee
|
64
|
+
Chorasmian
|
63
65
|
Close_Punctuation
|
64
66
|
Cntrl
|
65
67
|
Common
|
@@ -79,6 +81,7 @@ Deseret
|
|
79
81
|
Devanagari
|
80
82
|
Diacritic
|
81
83
|
Digit
|
84
|
+
Dives_Akuru
|
82
85
|
Dogra
|
83
86
|
Duployan
|
84
87
|
Egyptian_Hieroglyphs
|
@@ -170,6 +173,7 @@ In_CJK_Unified_Ideographs_Extension_C
|
|
170
173
|
In_CJK_Unified_Ideographs_Extension_D
|
171
174
|
In_CJK_Unified_Ideographs_Extension_E
|
172
175
|
In_CJK_Unified_Ideographs_Extension_F
|
176
|
+
In_CJK_Unified_Ideographs_Extension_G
|
173
177
|
In_Carian
|
174
178
|
In_Caucasian_Albanian
|
175
179
|
In_Chakma
|
@@ -177,6 +181,7 @@ In_Cham
|
|
177
181
|
In_Cherokee
|
178
182
|
In_Cherokee_Supplement
|
179
183
|
In_Chess_Symbols
|
184
|
+
In_Chorasmian
|
180
185
|
In_Combining_Diacritical_Marks
|
181
186
|
In_Combining_Diacritical_Marks_Extended
|
182
187
|
In_Combining_Diacritical_Marks_Supplement
|
@@ -200,6 +205,7 @@ In_Deseret
|
|
200
205
|
In_Devanagari
|
201
206
|
In_Devanagari_Extended
|
202
207
|
In_Dingbats
|
208
|
+
In_Dives_Akuru
|
203
209
|
In_Dogra
|
204
210
|
In_Domino_Tiles
|
205
211
|
In_Duployan
|
@@ -263,6 +269,7 @@ In_Katakana
|
|
263
269
|
In_Katakana_Phonetic_Extensions
|
264
270
|
In_Kayah_Li
|
265
271
|
In_Kharoshthi
|
272
|
+
In_Khitan_Small_Script
|
266
273
|
In_Khmer
|
267
274
|
In_Khmer_Symbols
|
268
275
|
In_Khojki
|
@@ -282,6 +289,7 @@ In_Linear_A
|
|
282
289
|
In_Linear_B_Ideograms
|
283
290
|
In_Linear_B_Syllabary
|
284
291
|
In_Lisu
|
292
|
+
In_Lisu_Supplement
|
285
293
|
In_Low_Surrogates
|
286
294
|
In_Lycian
|
287
295
|
In_Lydian
|
@@ -387,6 +395,7 @@ In_Supplementary_Private_Use_Area_B
|
|
387
395
|
In_Sutton_SignWriting
|
388
396
|
In_Syloti_Nagri
|
389
397
|
In_Symbols_and_Pictographs_Extended_A
|
398
|
+
In_Symbols_for_Legacy_Computing
|
390
399
|
In_Syriac
|
391
400
|
In_Syriac_Supplement
|
392
401
|
In_Tagalog
|
@@ -401,6 +410,7 @@ In_Tamil
|
|
401
410
|
In_Tamil_Supplement
|
402
411
|
In_Tangut
|
403
412
|
In_Tangut_Components
|
413
|
+
In_Tangut_Supplement
|
404
414
|
In_Telugu
|
405
415
|
In_Thaana
|
406
416
|
In_Thai
|
@@ -418,6 +428,7 @@ In_Vedic_Extensions
|
|
418
428
|
In_Vertical_Forms
|
419
429
|
In_Wancho
|
420
430
|
In_Warang_Citi
|
431
|
+
In_Yezidi
|
421
432
|
In_Yi_Radicals
|
422
433
|
In_Yi_Syllables
|
423
434
|
In_Yijing_Hexagram_Symbols
|
@@ -433,6 +444,7 @@ Kannada
|
|
433
444
|
Katakana
|
434
445
|
Kayah_Li
|
435
446
|
Kharoshthi
|
447
|
+
Khitan_Small_Script
|
436
448
|
Khmer
|
437
449
|
Khojki
|
438
450
|
Khudawadi
|
@@ -586,5 +598,6 @@ XDigit
|
|
586
598
|
XID_Continue
|
587
599
|
XID_Start
|
588
600
|
XPosixPunct
|
601
|
+
Yezidi
|
589
602
|
Yi
|
590
603
|
Zanabazar_Square
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.required_ruby_version = '>= 2.0.0'
|
26
26
|
|
27
27
|
s.add_development_dependency 'character_set', '~> 1.4.0'
|
28
|
-
s.add_development_dependency 'rake', '~>
|
28
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
29
29
|
s.add_development_dependency 'rake-compiler', '~> 1.0'
|
30
30
|
s.add_development_dependency 'range_compressor', '~> 1.0'
|
31
31
|
s.add_development_dependency 'rspec', '~> 3.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regexp_property_values
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.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: 2021-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: character_set
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,9 +90,9 @@ extensions:
|
|
90
90
|
- ext/regexp_property_values/extconf.rb
|
91
91
|
extra_rdoc_files: []
|
92
92
|
files:
|
93
|
+
- ".github/workflows/tests.yml"
|
93
94
|
- ".gitignore"
|
94
95
|
- ".rspec"
|
95
|
-
- ".travis.yml"
|
96
96
|
- CHANGELOG.md
|
97
97
|
- Gemfile
|
98
98
|
- LICENSE.txt
|
@@ -116,7 +116,7 @@ homepage: https://github.com/jaynetics/regexp_property_values
|
|
116
116
|
licenses:
|
117
117
|
- MIT
|
118
118
|
metadata: {}
|
119
|
-
post_install_message:
|
119
|
+
post_install_message:
|
120
120
|
rdoc_options: []
|
121
121
|
require_paths:
|
122
122
|
- lib
|
@@ -131,8 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
rubygems_version: 3.0.
|
135
|
-
signing_key:
|
134
|
+
rubygems_version: 3.3.0.dev
|
135
|
+
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Inspect property values supported by Ruby's regex engine
|
138
138
|
test_files: []
|