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 +4 -4
- data/lib/phony/countries.rb +3 -1
- data/spec/functional/plausibility_spec.rb +6 -6
- data/spec/lib/phony/countries_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f544b11a7d8e0f28ee13fc67d92fb3cd5a98f968ccfce3cb60b7781bc761fba5
|
4
|
+
data.tar.gz: cec200536113d42a5c6822c7d8e636b925a8c48ee062fc5ef99143548eb7cc13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4e9ac3559aa37f477e87e453c1316d12636fbedac8d9ae9f0e66e9af378009265abdf93882a159bfe6f42af2235e68a5cb55ec116593d2714de40b45c2c0d31
|
7
|
+
data.tar.gz: ed1fd348d0d1951c4de48ed8d7fca4f10c35f91d2a08b223d5fa14cbbf144c1d96a4d30e2c45af230760ad4733bbd9c053aded4f1c1052ed7ef618e6ef67dfab
|
data/lib/phony/countries.rb
CHANGED
@@ -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
|
-
|
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
|
572
|
-
Phony.plausible?('+260
|
573
|
-
Phony.plausible?('+260
|
574
|
-
Phony.plausible?('+260
|
575
|
-
Phony.plausible?('+260
|
576
|
-
Phony.plausible?('+260
|
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', '
|
855
|
-
it_splits '260967123456', ['260', '
|
856
|
-
it_splits '260978123456', ['260', '
|
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.
|
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-
|
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
|