phony 2.19.10 → 2.19.13

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: d8e8c59adf885678317d72197e37fc237635f43e83bdc49b3162dc0226142185
4
- data.tar.gz: fae6cff7e1fb009729a6098c69b76dd95f51596cac3c6ac1006562bd8759cdfd
3
+ metadata.gz: c8b500d924945f02432d8c59be7c70a3de2b2ee90af197f746c325877be4e8e7
4
+ data.tar.gz: 2365b18fa83a7da4e57cca35985337d0962eb6929315818f415031ad2447a6b4
5
5
  SHA512:
6
- metadata.gz: c75466301cd92d29728be0570c9c300697fa0c7c1ea00143420af3f4b5c2e6bd10d9e39bbe4327946be6703bef773ad36df9328fdb7bb8838647726352d6b0af
7
- data.tar.gz: 38ffb42f3b733f312b83b9d37d7e5f678836fd4be25b611f73d6465198491508ba14352a77687f3db4507ba44de3ef61a8cd2d1fc30b94df2946587b42c4e5bd
6
+ metadata.gz: a27aae884d2a466dbb0bbe613190f4b052e458810f55b0d3764431252938863c47d8db22f0bedf3a08ff95cc4c2d45d9b5d5c6afbc69e60d0f75c6b2126fd1d1
7
+ data.tar.gz: 91f9d8805a7097fbd0bc2132e20c3e1bf91ccd1b02c107b30a191f9f42432f7337269794fc3cb0cdc90300bd9c38adb939b5157d8543329569c334ec981eed74
@@ -272,7 +272,12 @@ Phony.define do
272
272
  country '39', trunk('', normalize: false) |
273
273
  one_of(*service) >> split(3,3) |
274
274
  one_of(*mobile) >> split(3,4,-1..1) |
275
- one_of(*ndcs_2digit) >> split(4, 2..4) |
275
+ one_of(*ndcs_2digit) >> matched_split(
276
+ /\A\d{5}\z/ => [5],
277
+ /\A\d{6}\z/ => [4,2],
278
+ /\A\d{7}\z/ => [4,3],
279
+ /\A\d{8}\z/ => [4,4],
280
+ ) |
276
281
  one_of(*ndcs_3digit) >> matched_split(
277
282
  /^1\d{6}$/ => [7],
278
283
  /^1\d{7}$/ => [8],
@@ -403,7 +403,56 @@ Phony.define do
403
403
  country '81',
404
404
  trunk('0', normalize: true, format: true, split: true) |
405
405
  one_of(%w(20 50 60 70 90)) >> split(4,4) | # mobile, VoIP telephony
406
+ match(/\A(597)9[0178]\d+\z/) >> split(2,4) |
406
407
  one_of(ndcs_with_5_subscriber_numbers) >> split(1,4) |
408
+ match(/\A(4)70[019]\d+\z/) >> split(4,4) |
409
+ match(/\A(4)71\d+\z/) >> split(4,4) |
410
+ match(/\A(4)20\d+\z/) >> split(4,4) |
411
+ match(/\A(4)29[02-69]\d+\z/) >> split(4,4) |
412
+ match(/\A(15)4[018]\d+\z/) >> split(3,4) |
413
+ match(/\A(22)3[014-9]\d+\z/) >> split(3,4) |
414
+ match(/\A(25)[04][01]\d+\z/) >> split(3,4) |
415
+ match(/\A(25)5[0-69]\d+\z/) >> split(3,4) |
416
+ match(/\A(25)[68][01]\d+\z/) >> split(3,4) |
417
+ match(/\A(25)7[015-9]\d+\z/) >> split(3,4) |
418
+ match(/\A(25)917\d+\z/) >> split(3,4) |
419
+ match(/\A(25)999\d+\z/) >> split(3,4) |
420
+ match(/\A(26)4[016-9]\d+\z/) >> split(3,4) |
421
+ match(/\A(28)3[0134]\d+\z/) >> split(3,4) |
422
+ match(/\A(28)9[0-5]\d+\z/) >> split(3,4) |
423
+ match(/\A(29)17\d+\z/) >> split(3,4) |
424
+ match(/\A(29)3[015-9]\d+\z/) >> split(3,4) |
425
+ match(/\A(42)21\d+\z/) >> split(3,4) |
426
+ match(/\A(42)8[01456]\d+\z/) >> split(3,4) |
427
+ match(/\A(47)5[019]\d+\z/) >> split(3,4) |
428
+ match(/\A(47)9[019]\d+\z/) >> split(3,4) |
429
+ match(/\A(59)8[019]\d+\z/) >> split(3,4) |
430
+ match(/\A(59)9[01]\d+\z/) >> split(3,4) |
431
+ match(/\A(79)4[0-59]\d+\z/) >> split(3,4) |
432
+ match(/\A(79)5[01569]\d+\z/) >> split(3,4) |
433
+ match(/\A(79)6[0167]\d+\z/) >> split(3,4) |
434
+ match(/\A(82)4[0-39]\d+\z/) >> split(3,4) |
435
+ match(/\A(82)9[019]\d+\z/) >> split(3,4) |
436
+ match(/\A(82)92[1-9]\d+\z/) >> split(3,4) |
437
+ match(/\A(82)94[1-3]\d+\z/) >> split(3,4) |
438
+ match(/\A(82)96[0-47-9]\d+\z/) >> split(3,4) |
439
+ match(/\A(82)965[01346-9]\d+\z/) >> split(3,4) |
440
+ match(/\A(82)966[1-9]\d+\z/) >> split(3,4) |
441
+ match(/\A(83)76[6-8]\d+\z/) >> split(3,4) |
442
+ match(/\A(83)7[01789]\d+\z/) >> split(3,4) |
443
+ match(/\A(83)8[01]\d+\z/) >> split(3,4) |
444
+ match(/\A(86)36[23]\d+\z/) >> split(3,4) |
445
+ match(/\A(86)5[0-389]\d+\z/) >> split(3,4) |
446
+ match(/\A(86)55[23]\d+\z/) >> split(3,4) |
447
+ match(/\A(86)[01]\d+\z/) >> split(3,4) |
448
+ match(/\A(86)9[178]\d+\z/) >> split(3,4) |
449
+ match(/\A(86)72\d+\z/) >> split(3,4) |
450
+ match(/\A(86)8[019]\d+\z/) >> split(3,4) |
451
+ match(/\A(86)9[0145]\d+\z/) >> split(3,4) |
452
+ match(/\A(86)99[014-9]\d+\z/) >> split(3,4) |
453
+ match(/\A(99)331\d+\z/) >> split(3,4) |
454
+ match(/\A(99)34[357]\d+\z/) >> split(3,4) |
455
+ match(/\A(99)4[0178]\d+\z/) >> split(3,4) |
407
456
  one_of(ndcs_with_6_subscriber_numbers) >> split(2,4) |
408
457
  one_of(%w(120)) >> split(3,3) | # freephone
409
458
  one_of(%w(800)) >> split(3,4) | # freephone
@@ -414,6 +463,6 @@ Phony.define do
414
463
  one_of(ndcs_with_8_subscriber_numbers) >> split(4,4) |
415
464
  # TODO: 91(NDC) N(S)N length: 5-13 - Non-geographic number (Direct subscriber telephone service (legacy))
416
465
  fixed(2) >> split(4,4),
417
- :local_space => :- ,
418
- :space => :-
466
+ local_space: :-,
467
+ space: :-
419
468
  end
@@ -977,7 +977,7 @@ Phony.define do
977
977
  /\A800\d+\z/ => [3,3], # freephone
978
978
  /\A830\d+\z/ => [3,3], # shared cost
979
979
  /\A60\d+\z/ => [3,3], # wireless geographic
980
- /\A(72|75|76|77)\d+\z/ => [3,4], # mobile
980
+ /\A(71|72|75|76|77)\d+\z/ => [3,4], # mobile
981
981
  /\A84\d+\z/ => [3,4], # wireless geographic
982
982
  /\A\d+\z/ => [2,3] # geographic
983
983
  )
@@ -280,7 +280,8 @@ describe 'plausibility' do
280
280
  it_is_correct_for 'Guinea-Bissau', :samples => '+245 44 728 6998'
281
281
  it_is_correct_for 'Guyana', :samples => '+592 263 1234'
282
282
  it_is_correct_for 'Honduras (Republic of)', :samples => '+504 12 961 637'
283
- it_is_correct_for 'Italy', :samples => ['+39 0574 1234']
283
+ it_is_correct_for 'Italy', :samples => ['+39 0574 1234',
284
+ '+39 06 49911']
284
285
  it_is_correct_for 'Iraq', :samples => ['+964 1 123 4567',
285
286
  '+964 21 113 456',
286
287
  '+964 71 1234 5678']
@@ -460,8 +460,9 @@ describe 'country descriptions' do
460
460
  it_splits '3934869528123',['39', '348', '695', '2812', '3'] # Mobile (8-digit subscriber no - new)
461
461
  it_splits '393357210488', ['39', '335', '721', '0488'] # Mobile
462
462
  it_splits '393248644272', ['39', '324', '864', '4272'] # Mobile
463
- it_splits '3906123412', ['39', '06', '1234', '12'] # Roma 6 digit
464
- it_splits '39061234123', ['39', '06', '1234', '123'] # Roma 7 digit
463
+ it_splits '390612341', ['39', '06', '12341'] # Roma 5 digit
464
+ it_splits '3906123412', ['39', '06', '1234', '12'] # Roma 6 digit
465
+ it_splits '39061234123', ['39', '06', '1234', '123'] # Roma 7 digit
465
466
  it_splits '390612341234', ['39', '06', '1234', '1234'] # Roma 8 digit
466
467
  it_splits '3902888388', ['39', '02', '8883', '88'] # Milano 6 digit
467
468
  it_splits '39028883888', ['39', '02', '8883', '888'] # Milano 7 digit
@@ -1235,6 +1236,7 @@ describe 'country descriptions' do
1235
1236
  describe 'Samoa (Independent State of)' do
1236
1237
  it_splits '685800123', ['685', false, '800', '123']
1237
1238
  it_splits '68561123', ['685', false, '61', '123']
1239
+ it_splits '6857112345', ['685', false, '711', '2345']
1238
1240
  it_splits '6857212345', ['685', false, '721', '2345']
1239
1241
  it_splits '685830123', ['685', false, '830', '123']
1240
1242
  it_splits '685601234', ['685', false, '601', '234']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.10
4
+ version: 2.19.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-30 00:00:00.000000000 Z
11
+ date: 2022-06-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Fast international phone number (E164 standard) normalizing, splitting
14
14
  and formatting. Lots of formatting options: International (+.., 00..), national