phony 2.18.15 → 2.18.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8b68b69c83acc6190f9fc36b4d9d3b0db6878ddc4bdb2c7cfabae8a77ee3ddc
4
- data.tar.gz: 1552ef3d9749adde09192d5951218ec399aac9bfe7d5a40c6c5ac50cac6003be
3
+ metadata.gz: e2b9c50bfb64f0a6eb3e0f191645e5f31de7c33b91034fde8620aa93881dd90a
4
+ data.tar.gz: e0d17bcc147253b71f24d713c26b942587df86f002c24e85e1164ff72461db4f
5
5
  SHA512:
6
- metadata.gz: 375e4422e3e19806732fb2ccfee87905754b56822538ae2eaf357d3e9fdc6d3d3cbdf800d10ea202c45f9c5bfc5cd3fd634f40964b5248fe6bd46c1632aef4c7
7
- data.tar.gz: 75f9f196bf936e481741a1c9f45f23bcc0d695843288505a57467d01edc8d0cdc1daa898083e12d402b582f0b8b46c22413d9b94e58714fe54bbed6cd352ab60
6
+ metadata.gz: b05a78e8c484e48b7656489b0d1388c990aadbd2634f30e7283ae98cb4bb96d9aa8466eb9bf98ca1a3845b4fa7f450d4ea115d63d4d0b5b24c8c5cb448003c1b
7
+ data.tar.gz: 48bad87202e0c1424bc6ea2458f9042de35a74b03d536c3a0267027dc742a9178632e44c14a1ce4b51956cd005a625ea722008af2f308e01c648b35b5ef36b74
@@ -352,13 +352,13 @@ Phony.define do
352
352
 
353
353
  # Côte d'Ivoire
354
354
  # http://www.wtng.info/wtng-225-ci.html
355
- # http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000310001PDFE.pdf
355
+ # https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000310006PDFE.pdf
356
356
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Ivory_Coast
357
357
  #
358
358
  # There is no trunk code for this country and several of the mobile prefixes start with 0
359
359
  country '225',
360
360
  trunk('', :normalize => false) |
361
- fixed(2) >> split(2,2,2)
361
+ fixed(2) >> split(2,2,2,2)
362
362
 
363
363
  country '226', none >> split(4,4) # Burkina Faso http://www.wtng.info/wtng-226-bf.html
364
364
  country '227', none >> split(4,4) # Niger http://www.wtng.info/wtng-227-ne.html
@@ -397,6 +397,7 @@ Phony.define do
397
397
  country '234',
398
398
  match(/^([7-9]0\d)\d+$/) >> split(3,4) | # Mobile
399
399
  match(/^(81\d)\d+$/) >> split(3,4) | # Mobile
400
+ match(/^(91\d)\d+$/) >> split(3,4) | # Mobile
400
401
  one_of('1', '2') >> split(3,3..4) | # Lagos, Ibadan
401
402
  one_of('9') >> split(3,4) | # Abuja
402
403
  one_of((30..79).map(&:to_s)) >> split(3,2..3) | # 2-digit NDC
@@ -409,7 +410,9 @@ Phony.define do
409
410
  country '239', fixed(1) >> split(3,3) # Sao Tome and Principe, http://www.wtng.info/wtng-239-st.html
410
411
 
411
412
  country '240', none >> split(3,3,3) # Equatorial Guinea
412
- country '241', fixed(1) >> split(3,3) # Gabonese Republic http://www.wtng.info/wtng-241-ga.html
413
+ country '241',
414
+ match(/^(\d)\d{6}$/) >> split(3,3) | # Gabonese Republic http://www.wtng.info/wtng-241-ga.html
415
+ match(/^(\d\d)\d{6}$/) >> split(2,2,2) # 2019 update https://en.wikipedia.org/wiki/Telephone_numbers_in_Gabon
413
416
  country '242', # Congo http://www.wtng.info/wtng-242-cg.html
414
417
  trunk('', :normalize => false) |
415
418
  none >> split(4,5)
@@ -9,14 +9,14 @@
9
9
  #
10
10
  # References:
11
11
  # http://www.comreg.ie/_fileupload/publications/ComReg03147.pdf (2003)
12
+ # https://www.comreg.ie/media/dlm_uploads/2015/12/ComReg0804.pdf (2008)
12
13
  # http://www.comreg.ie/licensing_and_services/area_code_maps.552.1040.html
13
14
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_the_Republic_of_Ireland
14
15
  #
15
16
  ndcs_with_5_subscriber_digits = [
16
- '22', '23', '24', '25', '26', '27', '28', '29', # Mallow, Bandon, Youghal, Fermoy, Macroom, Bantry, Skibbereen, Kanturk
17
+ '22', '24', '25', '26', '27', '28', '29', # Mallow, Youghal, Fermoy, Macroom, Bantry, Skibbereen, Kanturk
17
18
  '402', # Arklow
18
19
  '404', # Wicklow
19
- '43', # Longford, Granard
20
20
  '47', # Monaghan, Clones
21
21
  '48', # Northern Ireland
22
22
  '502', # Portlaoise, Abbeyleix
@@ -24,12 +24,10 @@ ndcs_with_5_subscriber_digits = [
24
24
  '505', # Roscrea
25
25
  '506', # Tullamore
26
26
  '509', # Bin-
27
- '52', # Killenaule
28
27
  '54', # Legacy Ferns, Enniscorthy
29
28
  '55', # Legacy Gorey
30
29
  '62', # Tipperary, Cashel
31
30
  '63', # Charleville
32
- '64', # Killarney, Rathmore
33
31
  '67', # Nenagh
34
32
  '68', # Listowel
35
33
  '69', # Newcastle West
@@ -47,15 +45,19 @@ ndcs_with_6_subscriber_digits = [
47
45
  ndcs_with_7_subscriber_digits = [
48
46
  '1', # Dublin
49
47
  '21', # Cork, Coachford, Kinsale
48
+ '23', # Bandon
50
49
  '41', # Ardee
51
50
  '42', # Dundalk, Carrickmacross, Castleblaney
51
+ '43', # Longford, Granard
52
52
  '44', # Mullingar, Castlepollard, Tyrellspass
53
53
  '46', # Navan, Kells, Trim, Enfield, Edenderry
54
54
  '49', # Cavan, Cootehill, Oldcastle, Belturbet
55
+ '52', # Killenaule
55
56
  '53', # Wexford, Enniscorthy, Ferns, Gorey, Craanford
56
57
  '56', # Kilkenny, Castlecomer
57
58
  '58', # Dungarvan
58
59
  '59', # Carlow, Muine Bheag, Athy, Baltinglass
60
+ '64', # Killarney, Rathmore
59
61
  '65', # Ennistymon, Kilrush
60
62
  '66', # Tralee, Dingle, Killorglin, Cahirciveen
61
63
  '71', # Sligo, Manorhamilton, Carrick-on-Shannon
@@ -8,6 +8,9 @@ Phony.define do
8
8
  trunk('0') |
9
9
  one_of(%w(800)) >> split(3,2) | # freephone
10
10
  one_of(%w(808)) >> split(3,2) | # payphone
11
+ one_of(%w(677 678)) >> matched_split(
12
+ /\A\d{4}\z/ => [3],
13
+ /\A\d+\z/ => [3,3]) |
11
14
  one_of(%w(230)) >> matched_split(
12
15
  /\A\d{4}\z/ => [4],
13
16
  /\A\d+\z/ => [3,2]) |
@@ -21,6 +24,7 @@ Phony.define do
21
24
  one_of(%w(72)) >> split(3,3) | # ISP
22
25
  one_of(%w(60 61 68 69)) >> matched_split(
23
26
  /\A\d{3}\z/ => [3],
27
+ /\A\d{6}\z/ => [3,3],
24
28
  /\A\d{7}\z/ => [3,4],
25
29
  /\A\d+\z/ => [3,3,4]) | # mobile, voicemail (mobile)
26
30
  one_of(%w(66 63)) >> matched_split(
@@ -40,4 +44,4 @@ Phony.define do
40
44
  fixed(2) >> matched_split(
41
45
  /\A\d{5}\z/ => [3,2],
42
46
  /\A\d+\z/ => [3,3])
43
- end
47
+ end
@@ -104,6 +104,7 @@ mobile = [
104
104
  '84', # Vinaphone
105
105
  '85', # Vinaphone
106
106
  '86', # Viettel
107
+ '87', # Itelecom
107
108
  '88', # Vinaphone
108
109
  '89', # MobiFone,
109
110
  '90', # MobiFone
@@ -192,7 +192,7 @@ describe 'plausibility' do
192
192
  Phony.plausible?('+385 60 12 345').should be_truthy # Premium rate
193
193
  Phony.plausible?('+385 62 123 456').should be_truthy # Premium, personal and UAN
194
194
  end
195
- it_is_correct_for "Côte d'Ivoire", :samples => '+225 9358 8764'
195
+ it_is_correct_for "Côte d'Ivoire", :samples => '+225 01 9358 8764'
196
196
  it_is_correct_for 'Democratic Republic of Timor-Leste', :samples => ['+670 465 7886', '+670 7465 7886']
197
197
  it_is_correct_for 'Democratic Republic of the Congo', :samples => '+243 80 864 9794'
198
198
  it_is_correct_for 'Diego Garcia', :samples => '+246 123 7686'
@@ -249,7 +249,14 @@ describe 'plausibility' do
249
249
  end
250
250
  it_is_correct_for 'French Guiana (French Department of)', :samples => '+594 594 123 456'
251
251
  it_is_correct_for "French Polynesia (Territoire français d'outre-mer)", :samples => '+689 87 27 84 00'
252
- it_is_correct_for 'Gabonese Republic', :samples => '+241 1 627 739'
252
+ it 'is correct for Gabon' do
253
+ Phony.plausible?('+241 1 627 739').should be_truthy
254
+ Phony.plausible?('+241 12 34 56 78').should be_truthy
255
+ end
256
+ # it_is_correct_for 'Gabonese Republic', :samples => [
257
+ # '+241 1 627 739',
258
+ # '+241 12 34 56 78',
259
+ # ]
253
260
  it_is_correct_for 'Gambia', :samples => '+220 989 5148'
254
261
  it_is_correct_for 'Germany', :samples => [
255
262
  '+49 69 155 1',
@@ -420,8 +427,10 @@ describe 'plausibility' do
420
427
  ['+381 11 123 456', '+381 11 123 4567'],
421
428
  '+381 72 123 456',
422
429
  '+381 60 123',
423
- '+381 60 123 4567',
430
+ ['+381 60 123 4567', '+381 69 123 456'],
424
431
  '+381 42 123 456',
432
+ '+381 677 123 456',
433
+ '+381 678 123 456',
425
434
  '+381 9 123 4567',
426
435
  '+381 60 123',
427
436
  '+381 60 123 456 7890',
@@ -895,8 +895,8 @@ describe 'country descriptions' do
895
895
  it_splits '50622345678', %w(506 2 234 5678)
896
896
  end
897
897
  describe "Côte d'Ivoire" do
898
- it_splits '22507335518', ['225', '07', '33', '55', '18']
899
- it_splits '22537335518', ['225', '37', '33', '55', '18']
898
+ it_splits '2250107335518', ['225', '01', '07', '33', '55', '18']
899
+ it_splits '2250237335518', ['225', '02', '37', '33', '55', '18']
900
900
  end
901
901
  describe 'Democratic Republic of Timor-Leste' do
902
902
  it_splits '6701742945', ['670', false, '174', '2945']
@@ -959,6 +959,7 @@ describe 'country descriptions' do
959
959
  end
960
960
  describe 'Gabonese Republic' do
961
961
  it_splits '2411834375', ['241', '1', '834', '375']
962
+ it_splits '24174012345', ['241', '74', '01', '23', '45']
962
963
  end
963
964
  describe 'Gambia' do
964
965
  it_splits '2206683355', ['220', false, '668', '3355']
@@ -1163,6 +1164,17 @@ describe 'country descriptions' do
1163
1164
  it_splits '2349087661234', %w(234 908 766 1234)
1164
1165
  it_splits '2349097661234', %w(234 909 766 1234)
1165
1166
 
1167
+ it_splits '2349107661234', %w(234 910 766 1234)
1168
+ it_splits '2349117661234', %w(234 911 766 1234)
1169
+ it_splits '2349127661234', %w(234 912 766 1234)
1170
+ it_splits '2349137661234', %w(234 913 766 1234)
1171
+ it_splits '2349147661234', %w(234 914 766 1234)
1172
+ it_splits '2349157661234', %w(234 915 766 1234)
1173
+ it_splits '2349167661234', %w(234 916 766 1234)
1174
+ it_splits '2349177661234', %w(234 917 766 1234)
1175
+ it_splits '2349187661234', %w(234 918 766 1234)
1176
+ it_splits '2349197661234', %w(234 919 766 1234)
1177
+
1166
1178
  it_splits '2348107661234', %w(234 810 766 1234)
1167
1179
  it_splits '2348117661234', %w(234 811 766 1234)
1168
1180
  it_splits '2348127661234', %w(234 812 766 1234)
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.18.15
4
+ version: 2.18.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-12 00:00:00.000000000 Z
11
+ date: 2021-03-29 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
@@ -95,11 +95,11 @@ files:
95
95
  - spec/lib/phony/national_splitters/variable_spec.rb
96
96
  - spec/lib/phony/vanity_spec.rb
97
97
  - spec/lib/phony_spec.rb
98
- homepage: http://github.com/floere/phony
98
+ homepage: https://github.com/floere/phony
99
99
  licenses:
100
100
  - MIT
101
101
  metadata: {}
102
- post_install_message:
102
+ post_install_message:
103
103
  rdoc_options: []
104
104
  require_paths:
105
105
  - lib
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubygems_version: 3.0.3
118
- signing_key:
118
+ signing_key:
119
119
  specification_version: 4
120
120
  summary: Fast international phone number (E164 standard) normalizing, splitting and
121
121
  formatting.