phony 2.19.11 → 2.19.14

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: d971b51de8e8d0581c884f90238d00bbdeeee7ca248ae3b93ce75e5b759114fd
4
- data.tar.gz: d37f03c8ca22a2fcf76b046a38cfd6cc6334d79cd377bb221e1610352b331ee7
3
+ metadata.gz: 4f497a4a52bd0c47e845d1fa471e5465e1c949349fdcf78cf5e6f4ef6f501ee9
4
+ data.tar.gz: 64bff396ac5a0a20fd27a8b8176ea71ec3fc569c129c7297e7910ae02b1a473d
5
5
  SHA512:
6
- metadata.gz: '028169288dfdcd908210a144add1c6d6eb082703602fd4eaa069c9ca952fe8e3e8c0c46764244af569cf90ba5fb535681369b700e3f273bebde591c534e544d3'
7
- data.tar.gz: dc281117fa228352a099b3dc28e77d13c7d8145ef93f50ab721817e6b0a6024a32e4f4587c191529142ba987498b62d9a1bd3b9c4cfbf3ae72f2537b70e375ab
6
+ metadata.gz: 20f087521f9e50b8fa1b31418ad24363fe97949ca7eae3b787429dbfdd2c8ee83d66a99f898033e5890e76351517fc237746084e68d33878d7a258c69179bfb8
7
+ data.tar.gz: a29e55bf204811d025b7ba758ab04e3584eabb43ccefc9011c8bc4c6b1e122f5e50ad5b8f714012a35c6c4e637d5894a2272ea40810765e01de3b3c24d85497a
data/README.textile CHANGED
@@ -106,6 +106,10 @@ h2. List of Handled Countries
106
106
 
107
107
  Mildly unmaintained list: Abhas, Afghan, Algerian, Argentina, Austrian, Australian, Azerbaijani, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, El Salvadorian, Estonian, French, German, Ghanan, Gibraltar, Greek, Haiti, Hong Kong, Hungarian, Indian, Iran, Irish, Israel, Italian, Japanese, Kazakh, Liberian, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Seychelles, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sri Lankan, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, Vietnamese, and Zambian numbers.
108
108
 
109
+ h2. Proud Sponsors
110
+
111
+ * Renuo AG (July 22 –): "Github":https://github.com/renuo, "Homepage":https://www.renuo.ch
112
+
109
113
  h2. License
110
114
 
111
115
  MIT.
@@ -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
@@ -232,6 +232,7 @@ Phony.define do
232
232
  # http://www.itu.int/oth/T020200002C/en
233
233
  country '57',
234
234
  match(/\A(3\d\d)\d+\z/) >> split(3,4) | # mobile (300 310 311 312 313 315 316)
235
+ match(/\A(60\d)\d+\z/) >> split(3,4) |
235
236
  fixed(1) >> split(3,4)
236
237
 
237
238
  # Venezuela (Bolivarian Republic of)
@@ -179,6 +179,14 @@ describe 'plausibility' do
179
179
  Phony.plausible?('+359 998 123456').should be_truthy
180
180
  Phony.plausible?('+359 999 123456').should be_truthy
181
181
  end
182
+ it_is_correct_for 'Colombia', :samples => ['+57 601 411 1899',
183
+ '+57 602 111 2222',
184
+ '+57 603 111 2222',
185
+ '+57 604 111 2222',
186
+ '+57 605 111 2222',
187
+ '+57 606 111 2222',
188
+ '+57 607 111 2222',
189
+ '+57 608 111 2222']
182
190
  it_is_correct_for 'Congo', :samples => '+242 1234 56789'
183
191
  it_is_correct_for 'Cook Islands', :samples => '+682 71928'
184
192
  it_is_correct_for 'Costa Rica', :samples => '+506 2 234 5678'
@@ -280,7 +288,8 @@ describe 'plausibility' do
280
288
  it_is_correct_for 'Guinea-Bissau', :samples => '+245 44 728 6998'
281
289
  it_is_correct_for 'Guyana', :samples => '+592 263 1234'
282
290
  it_is_correct_for 'Honduras (Republic of)', :samples => '+504 12 961 637'
283
- it_is_correct_for 'Italy', :samples => ['+39 0574 1234']
291
+ it_is_correct_for 'Italy', :samples => ['+39 0574 1234',
292
+ '+39 06 49911']
284
293
  it_is_correct_for 'Iraq', :samples => ['+964 1 123 4567',
285
294
  '+964 21 113 456',
286
295
  '+964 71 1234 5678']
@@ -240,7 +240,7 @@ describe 'country descriptions' do
240
240
  end
241
241
  end
242
242
  describe 'Colombia' do
243
- it_splits '5711234567', ['57', '1', '123', '4567']
243
+ it_splits '5711234567', ['57', '1', '123', '4567'] # Outdated.
244
244
  it_splits '573101234567', ['57', '310', '123', '4567'] # mobile
245
245
  end
246
246
  describe 'Croatia' do
@@ -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
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.11
4
+ version: 2.19.14
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-04-21 00:00:00.000000000 Z
11
+ date: 2022-07-13 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
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.1.6
118
+ rubygems_version: 3.0.3
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Fast international phone number (E164 standard) normalizing, splitting and