phony 2.19.11 → 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: d971b51de8e8d0581c884f90238d00bbdeeee7ca248ae3b93ce75e5b759114fd
4
- data.tar.gz: d37f03c8ca22a2fcf76b046a38cfd6cc6334d79cd377bb221e1610352b331ee7
3
+ metadata.gz: 54699e3eb844624a7259e6ada8eb7723f464fc1c76be1a1509a2a3742da886af
4
+ data.tar.gz: bf0beaa674cd0c692b604aaada2af2c9ecbaeca220bdcd2d80c1bb6442e5f5d6
5
5
  SHA512:
6
- metadata.gz: '028169288dfdcd908210a144add1c6d6eb082703602fd4eaa069c9ca952fe8e3e8c0c46764244af569cf90ba5fb535681369b700e3f273bebde591c534e544d3'
7
- data.tar.gz: dc281117fa228352a099b3dc28e77d13c7d8145ef93f50ab721817e6b0a6024a32e4f4587c191529142ba987498b62d9a1bd3b9c4cfbf3ae72f2537b70e375ab
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,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
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.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-04-21 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