phony 2.14.10 → 2.14.11
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/zimbabwe.rb +3 -3
- data/spec/lib/phony/countries_spec.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 236cbea6eafc78710f947dfecec5784685afea02
|
4
|
+
data.tar.gz: a207d5d46d5dc6bd37c3427e5a6f135f259f93a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bceafeb723a4ec649d0f37463f0626f0b29f0171ee2181e7e01e0046f7d70e99f06b7b96bc0b3e1acf08a23b470d9f448f3982ad4210ff0e9467f77a0d1eb69a
|
7
|
+
data.tar.gz: f89ea16b66d5376f57fa433b8c55cb81e3a85c781b954a43c88f45e546027036ab85da357bb4ea46fca30a0d187986a576ccc78ca6513c002b455d9e9cce89c5
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# Zimbabwe, https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=ZW
|
2
|
+
# http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000E90002PDFE.pdf
|
2
3
|
|
3
4
|
Phony.define do
|
4
5
|
country '263',
|
6
|
+
trunk('0', normalize: true) |
|
5
7
|
one_of(%w(2582 2583 5483)) >>
|
6
8
|
matched_split(/\A\d{6}\z/ => [3,3],
|
7
9
|
/\A\d+\z/ => [3] ) | # geographic [XXXX] XXX(XXX)
|
@@ -16,8 +18,6 @@ Phony.define do
|
|
16
18
|
one_of(%w(273 275 277 278 279 282 285)) >>
|
17
19
|
matched_split(/\A\d{6}\z/ => [3,3],
|
18
20
|
/\A\d+\z/ => [2,2] ) | # geographic [XXX] XXXX(XX)
|
19
|
-
one_of(%w(912)) >>
|
20
|
-
matched_split(/\A\d{8}\z/ => [4,4], /\A\d+\z/ => [3]) | # mobile
|
21
21
|
one_of(%w(13 14 15 16 17 18 19 21 24 26 29 30 31 32 34 35 36 50 55 57 58 59 60
|
22
22
|
63 64 65 66 69)) >>
|
23
23
|
matched_split(/\A\d{6}\z/ => [3,3],
|
@@ -29,7 +29,7 @@ Phony.define do
|
|
29
29
|
matched_split(/\A\d{6}\z/ => [3,3],
|
30
30
|
/\A\d+\z/ => [2,2] ) | # geographic [XXX] XXXX(XX)
|
31
31
|
one_of(%w(86)) >> split(4,4) | # VoIP telephony
|
32
|
-
one_of(%w(71 73 77)) >> split(4
|
32
|
+
one_of(%w(71 73 77 78)) >> split(3,4) | # mobile
|
33
33
|
one_of(%w(4 9)) >>
|
34
34
|
matched_split(/\A\d{6}\z/ => [4,4],
|
35
35
|
/\A\d+\z/ => [3,2] ) | # geographic [X] XXXXX(XXX)
|
@@ -797,7 +797,7 @@ describe 'country descriptions' do
|
|
797
797
|
it_splits '299691123', ['299', '691', '123']
|
798
798
|
end
|
799
799
|
describe 'Guadeloupe (French Department of)' do
|
800
|
-
it_splits '
|
800
|
+
it_splits '590590456789', %w(590 590 45 67 89)
|
801
801
|
end
|
802
802
|
describe 'Guatemala (Republic of)' do
|
803
803
|
it_splits '50219123456789', ['502', '19', '123', '456', '789']
|
@@ -897,7 +897,7 @@ describe 'country descriptions' do
|
|
897
897
|
it_splits '6924226536', ['692', false, '422', '6536']
|
898
898
|
end
|
899
899
|
describe 'Martinique (French Department of)' do
|
900
|
-
it_splits '
|
900
|
+
it_splits '596596123456', %w(596 596 12 34 56)
|
901
901
|
end
|
902
902
|
describe 'Mauritania' do
|
903
903
|
it_splits '22212345678', ['222', false, '1234', '5678']
|
@@ -1027,7 +1027,7 @@ describe 'country descriptions' do
|
|
1027
1027
|
it_splits '67511512345678', %w(675 115 1234 5678)
|
1028
1028
|
end
|
1029
1029
|
describe 'Reunion / Mayotte (new)' do
|
1030
|
-
it_splits '
|
1030
|
+
it_splits '262594399265', ['262', '594', '39', '92', '65']
|
1031
1031
|
end
|
1032
1032
|
describe 'Saint Helena' do
|
1033
1033
|
it_splits '2903614', ['290', false, '3614']
|
@@ -1205,6 +1205,12 @@ describe 'country descriptions' do
|
|
1205
1205
|
it_splits '263270123456', %w(263 270 123 456)
|
1206
1206
|
it_splits '26327012345', %w(263 270 123 45)
|
1207
1207
|
it_splits '2638612354567', %w(263 86 1235 4567)
|
1208
|
+
|
1209
|
+
# mobile numbers (see http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000E90002PDFE.pdf, Table 4, Page 25)
|
1210
|
+
%w(71 73 77 78).each do |prefix|
|
1211
|
+
number = "263#{prefix}2345678"
|
1212
|
+
it_splits number, ['263', prefix, '234', '5678']
|
1213
|
+
end
|
1208
1214
|
end
|
1209
1215
|
end
|
1210
1216
|
|
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.14.
|
4
|
+
version: 2.14.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-27 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
|