regexp_property_values 1.0.0-java → 1.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df5f6a7ffc9dd0e318688e3e021b85f9aa1f0d6989fb241094748716879e22a9
4
- data.tar.gz: f5c43c30c5df8b6c2839d8958b9d2bd5df1969c060969b709971a2b9aa4b4b20
3
+ metadata.gz: 9f966d2a053fd6449376150cc850188ef3f14bec67d7889f968a58810647abda
4
+ data.tar.gz: 7034649d328192e3e8a63f507f81bc5c7bd78ce26ebf4c30fd69275b627af5aa
5
5
  SHA512:
6
- metadata.gz: 1b28308b9f488330f36b42e6608de106564c855204fa8dbde67b9dbe68327e49f938926a464f9d087d0a6c7f8c079d8196479cc886796283c62d43ba61be7924
7
- data.tar.gz: 5df213fc40e2dac62f0f382bab8305211a9b8bc11751c8cada1fa05f5ab5e6843708f2a769a2a0761bb1f0ce293a68ac4930db4bdbf6643600293a04a82a9bb0
6
+ metadata.gz: 2cb32ec5210d0d1de763a64a8d64527aa2c05b7303428fdcdc42e086a776dc158c6f4fd89d94f7a806f3ce753b1e6f25829914a7f9cbf1b58db6c7db98bb31ab
7
+ data.tar.gz: b68b395f9fd73e39758bf8111cf3a2a57db70a699c43aa16eb0aa9e01ba3ee09edcca57bcc912fc7eb4530edbc36949536e8f5f57b66ec5cc2049f912da9d1cc
@@ -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
@@ -15,6 +15,7 @@
15
15
  .ruby-version
16
16
  .tags
17
17
  .tags1
18
+ .tool-versions
18
19
  bbin/
19
20
  binstubs/*
20
21
  bundler_stubs/*/.yardoc
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://travis-ci.org/jaynetics/regexp_property_values.svg?branch=master)](https://travis-ci.org/jaynetics/regexp_property_values)
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
- puts 'This will load ucd and emoji data for the CURRENT RUBY '\
44
- "(#{unicode_version} / #{emoji_version}). Run this on the "\
45
- 'latest Ruby version you want to support. Continue? [y/n]'
46
- return puts 'download skipped.' unless $stdin.gets =~ /^y/i
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 #{BASE_URL}/#{unicode_version}/ucd/#{f}` }
50
- EMOJI_FILES.each { |f| `wget #{BASE_URL}/emoji/#{emoji_version}/#{f}` }
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
 
@@ -1,3 +1,3 @@
1
1
  module RegexpPropertyValues
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -31,7 +31,7 @@ module RegexpPropertyValues
31
31
  end.to_h
32
32
  end
33
33
 
34
- def self.update
35
- Updater.call
34
+ def self.update(ucd_path: nil, emoji_path: nil)
35
+ Updater.call(ucd_path: ucd_path, emoji_path: emoji_path)
36
36
  end
37
37
  end
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', '~> 12.0'
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.0.0
4
+ version: 1.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - Janosch Müller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-16 00:00:00.000000000 Z
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: '12.0'
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: '12.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake-compiler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,9 +103,9 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".github/workflows/tests.yml"
106
107
  - ".gitignore"
107
108
  - ".rspec"
108
- - ".travis.yml"
109
109
  - CHANGELOG.md
110
110
  - Gemfile
111
111
  - LICENSE.txt
@@ -129,7 +129,7 @@ homepage: https://github.com/jaynetics/regexp_property_values
129
129
  licenses:
130
130
  - MIT
131
131
  metadata: {}
132
- post_install_message:
132
+ post_install_message:
133
133
  rdoc_options: []
134
134
  require_paths:
135
135
  - lib
@@ -144,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.0.3
148
- signing_key:
147
+ rubygems_version: 3.3.0.dev
148
+ signing_key:
149
149
  specification_version: 4
150
150
  summary: Inspect property values supported by Ruby's regex engine
151
151
  test_files: []
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.1
5
- - 2.4
6
- - 2.5
7
- - 2.6
8
- - jruby-9.1.9.0