phony 2.19.9 → 2.19.12

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: 30b195be2f2aafc2cda3d6f6f32f1f8b5c5af7dc11d63e03cb329fb4fdf40556
4
- data.tar.gz: 6f4cc992009707e109eb9c50efea3b6c38fd2c7452434d23aa44b401559ffd1c
3
+ metadata.gz: 54699e3eb844624a7259e6ada8eb7723f464fc1c76be1a1509a2a3742da886af
4
+ data.tar.gz: bf0beaa674cd0c692b604aaada2af2c9ecbaeca220bdcd2d80c1bb6442e5f5d6
5
5
  SHA512:
6
- metadata.gz: 77892f621ff0ad9455ad7eabaf6a8f2beee67f79fc09ade1913295c92f649e4c5790a5dc6336a32cb095f136b0bf46c2f9a1582f196ee8a988d4465ea1640a02
7
- data.tar.gz: 6f585de726af1584d89eeec8dd41e6dbb25cf740acf144149ada1a8bd5d461149c8eea341629fe0746fbecfecab38990eb0dc5b992efe7c94832fae6472c41f4
6
+ metadata.gz: 71dd377780c26bdb99e8c787a27b12f9a03b50af1d336971e3007511251edbd74bfeb3019dc827e81d6b63b97a02c9e509db7ab055c2e25db317f257cf77baab
7
+ data.tar.gz: 278418af47c803338069c0c205c65fd1f575f47644313e3eb96ca5c5324f51c832e05db8bab47873ba7e650012dc2854f4cad6f9bafafe08e39271d68c4d869f
@@ -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],
@@ -280,6 +285,7 @@ Phony.define do
280
285
  /^[^1]\d{6}$/ => [7]
281
286
  ) |
282
287
  one_of(*ndcs_4digit) >> matched_split(
288
+ /\A\d{4}\z/ => [4],
283
289
  /^1\d{5}$/ => [6],
284
290
  /^1\d{6}$/ => [7],
285
291
  /^[^1]\d{4}$/ => [5],
@@ -111,6 +111,6 @@ Phony.define do
111
111
  one_of(ndcs_with_5_subscriber_numbers) >> split(3,2) |
112
112
  one_of(ndcs_with_6_subscriber_numbers) >> split(3,3) |
113
113
  one_of(ndcs_with_7_subscriber_numbers) >> split(4,3) |
114
- one_of(%w(91 92)) >> split(4,3) | # mobile
114
+ one_of(%w(91 92 94 95)) >> split(4,3) | # mobile
115
115
  fixed(2) >> split(3,3)
116
116
  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,6 +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',
284
+ '+39 06 49911']
283
285
  it_is_correct_for 'Iraq', :samples => ['+964 1 123 4567',
284
286
  '+964 21 113 456',
285
287
  '+964 71 1234 5678']
@@ -516,7 +518,10 @@ describe 'plausibility' do
516
518
  it_is_correct_for 'Lybia', :samples => ['+218 205 123 45',
517
519
  '+218 22 123 456',
518
520
  '+218 21 1234 456',
519
- '+218 91 1234 456']
521
+ '+218 91 1234 456',
522
+ '+218 92 1234 456',
523
+ '+218 94 1234 456',
524
+ '+218 95 1234 456']
520
525
  it_is_correct_for 'Mongolia', :samples => ['+976 11 123 45',
521
526
  ['+976 121 12 34', '+976 121 12 345'],
522
527
  '+976 70 123 456',
@@ -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
@@ -470,6 +471,7 @@ describe 'country descriptions' do
470
471
  it_splits '3903123391', ['39', '031', '23391'] # Como
471
472
  it_splits '390909709511', ['39', '090', '9709511'] # Barcellona
472
473
  it_splits '390471811353', ['39', '0471', '811', '353'] # Bolzano
474
+ it_splits '3905745730', ['39', '0574', '5730'] # Prato
473
475
  end
474
476
  describe 'Japan' do
475
477
  it_splits '81312345678', %w(81 3 1234 5678) # Tokyo
@@ -1052,6 +1054,8 @@ describe 'country descriptions' do
1052
1054
  it_splits '21822123456', %w(218 22 123 456)
1053
1055
  it_splits '218211234456', %w(218 21 1234 456)
1054
1056
  it_splits '218911234456', %w(218 91 1234 456)
1057
+ it_splits '218941234456', %w(218 94 1234 456)
1058
+ it_splits '218951234456', %w(218 95 1234 456)
1055
1059
  end
1056
1060
  describe 'Madagascar' do
1057
1061
  it_splits '261202254716', ['261', '20', *%w(22 547 16)]
@@ -1232,6 +1236,7 @@ describe 'country descriptions' do
1232
1236
  describe 'Samoa (Independent State of)' do
1233
1237
  it_splits '685800123', ['685', false, '800', '123']
1234
1238
  it_splits '68561123', ['685', false, '61', '123']
1239
+ it_splits '6857112345', ['685', false, '711', '2345']
1235
1240
  it_splits '6857212345', ['685', false, '721', '2345']
1236
1241
  it_splits '685830123', ['685', false, '830', '123']
1237
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.9
4
+ version: 2.19.12
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-02-15 00:00:00.000000000 Z
11
+ date: 2022-06-09 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