phony 2.19.6 → 2.19.7

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: ac3633c9c80cf15daea1dd2037b9480b9e4de9c29268e6f32922b5f2dc3f227c
4
- data.tar.gz: 76390500957d4eb37fd63b63d010f691374c6f5e07fce5f4a736b4749004736e
3
+ metadata.gz: f544b11a7d8e0f28ee13fc67d92fb3cd5a98f968ccfce3cb60b7781bc761fba5
4
+ data.tar.gz: cec200536113d42a5c6822c7d8e636b925a8c48ee062fc5ef99143548eb7cc13
5
5
  SHA512:
6
- metadata.gz: 32ddea147de2d58e78f726bcba48e7d3f7bfc83a4d8c29263774876bac5af0ef438aac3211bbf916e820796d640cafc11c59f86973721e911d1a2ed3d83ddd9e
7
- data.tar.gz: 2e3456336cc64377eee6690fe643fdb965e4377ef006a9cb603d5492ff0740e8d2729f24dfd8907b4695d09a294acc5dab43cd57f53d6ddd2f9ad84a20be53d8
6
+ metadata.gz: b4e9ac3559aa37f477e87e453c1316d12636fbedac8d9ae9f0e66e9af378009265abdf93882a159bfe6f42af2235e68a5cb55ec116593d2714de40b45c2c0d31
7
+ data.tar.gz: ed1fd348d0d1951c4de48ed8d7fca4f10c35f91d2a08b223d5fa14cbbf144c1d96a4d30e2c45af230760ad4733bbd9c053aded4f1c1052ed7ef618e6ef67dfab
@@ -486,8 +486,10 @@ Phony.define do
486
486
  # Zambia
487
487
  # http://www.wtng.info/wtng-260-zm.html
488
488
  # https://github.com/googlei18n/libphonenumber/
489
+ # https://en.wikipedia.org/wiki/Telephone_numbers_in_Zambia
489
490
  country '260',
490
- match(/^([79][5678]\d)/) >> split(6) | # Mobile
491
+ trunk('0') |
492
+ match(/^(76|77|95|96|97)/) >> split(3, 4) | # Mobile
491
493
  match(/^(800)/) >> split(3,3) | # Toll free
492
494
  match(/^(21[1-8])/) >> split(6) # Fixed
493
495
 
@@ -568,12 +568,12 @@ describe 'plausibility' do
568
568
  '+967 58 1234']
569
569
  it 'is correct for Zambia' do
570
570
  Phony.plausible?('+260 211 123456').should be_truthy # Fixed
571
- Phony.plausible?('+260 761 123456').should be_truthy # Mobile
572
- Phony.plausible?('+260 772 123456').should be_truthy # Mobile
573
- Phony.plausible?('+260 783 123456').should be_truthy # Mobile
574
- Phony.plausible?('+260 955 123456').should be_truthy # Mobile
575
- Phony.plausible?('+260 967 123456').should be_truthy # Mobile
576
- Phony.plausible?('+260 978 123456').should be_truthy # Mobile
571
+ Phony.plausible?('+260 96 512 4567').should be_truthy # MTN Mobile
572
+ Phony.plausible?('+260 97 712 3456').should be_truthy # Airtel Mobile
573
+ Phony.plausible?('+260 95 512 4567').should be_truthy # Zamtel Mobile
574
+ Phony.plausible?('+260 96 512 456').should be_falsy # MTN Mobile (Too short)
575
+ Phony.plausible?('+260 97 812 345').should be_falsy # Airtel Mobile (Too short)
576
+ Phony.plausible?('+260 95 512 345').should be_falsy # Zamtel Mobile (Too short)
577
577
  Phony.plausible?('+260 800 123 456').should be_truthy # Toll free
578
578
  end
579
579
  it_is_correct_for 'Zimbabwe', :samples => [['+263 2582 123 456', '+263 2582 123'],
@@ -851,9 +851,9 @@ describe 'country descriptions' do
851
851
  end
852
852
  describe 'Zambia' do
853
853
  it_splits '260211123456', ['260', '211', '123456'] # Fixed
854
- it_splits '260955123456', ['260', '955', '123456'] # Mobile
855
- it_splits '260967123456', ['260', '967', '123456'] # Mobile
856
- it_splits '260978123456', ['260', '978', '123456'] # Mobile
854
+ it_splits '260955123456', ['260', '95', '512', '3456'] # Mobile
855
+ it_splits '260967123456', ['260', '96', '712', '3456'] # Mobile
856
+ it_splits '260978123456', ['260', '97', '812', '3456'] # Mobile
857
857
  it_splits '260800123456', ['260', '800', '123', '456'] # Toll free
858
858
  end
859
859
  describe 'New Zealand' do
@@ -1433,7 +1433,7 @@ describe 'country descriptions' do
1433
1433
  describe 'Universal International Freephone' do
1434
1434
  it_splits '80012345678', ['800', false, '12345678']
1435
1435
  end
1436
-
1436
+
1437
1437
  describe 'Shared-Cost Service' do
1438
1438
  it_splits '80812345678', ['808', false, '12345678']
1439
1439
  end
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.6
4
+ version: 2.19.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-06 00:00:00.000000000 Z
11
+ date: 2021-11-16 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