phony 2.15.42 → 2.15.43
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 +4 -2
- data/lib/phony/countries/somalia.rb +3 -1
- data/spec/lib/phony/countries_spec.rb +5 -1
- data/spec/lib/phony/country_codes_spec.rb +7 -0
- 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: 6224b3a86d75b35405663ba54e9c4a0df59e3dca
|
4
|
+
data.tar.gz: 4865b3f594f023a6f5200d01aff512516883ceba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa5c624fd7dad4a7542d9983e04204b97f9d5d23e5188c760d08fc1e3678e92b17865e745c5a60cbe7cea84ab36e55e578e19f27bed1c2e36114f7a52787534
|
7
|
+
data.tar.gz: 66e69794dc94c5457ab7c66d1234e0fb3aecb50e3bed85548b4087f36711fbaee3e543467e7382fa4bf90db8d6914d72ea85a35a5d30fefe6a513ef19fbcfacc
|
data/lib/phony/countries.rb
CHANGED
@@ -178,7 +178,7 @@ Phony.define do
|
|
178
178
|
# Note: http://wapedia.mobi/en/Telephone_numbers_in_Poland, mobile not yet correct
|
179
179
|
#
|
180
180
|
country '48',
|
181
|
-
match(/^(5[
|
181
|
+
match(/^(45\d|5[0137]\d|6[069]\d|7[02389]\d|80[01]|88\d)/) >> split(3,3) |
|
182
182
|
fixed(2) >> split(3,2,2)
|
183
183
|
|
184
184
|
# country '49' # Germany, see special file.
|
@@ -401,7 +401,9 @@ Phony.define do
|
|
401
401
|
|
402
402
|
country '240', none >> split(3,3,3) # Equatorial Guinea
|
403
403
|
country '241', fixed(1) >> split(3,3) # Gabonese Republic http://www.wtng.info/wtng-241-ga.html
|
404
|
-
country '242',
|
404
|
+
country '242', # Congo http://www.wtng.info/wtng-242-cg.html
|
405
|
+
trunk('', :normalize => false) |
|
406
|
+
none >> split(4,5)
|
405
407
|
country '243', fixed(2) >> split(3,4) # Democratic Republic of the Congo http://www.wtng.info/wtng-243-cd.html
|
406
408
|
country '244', one_of('321', '348', '358', '363', '364', '485', '526', '535', '546', '612', '643', '652', '655', '722', '726', '728', '729', '777') >> split(3,3) | # Angola
|
407
409
|
fixed(2) >> split(3,4)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
Phony.define do
|
2
2
|
# Somali Democratic Republic http://www.wtng.info/wtng-252-so.html
|
3
3
|
# https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=SO
|
4
|
+
# https://en.wikipedia.org/wiki/Telecommunications_in_Somaliland#Telesom
|
4
5
|
country '252',
|
5
6
|
one_of('88216') >> split(3) | # Thuraya Satellite Telecommunications Company
|
6
7
|
one_of(%w(1034 1043)) >> split(3,2) | # Hortel
|
@@ -13,10 +14,11 @@ Phony.define do
|
|
13
14
|
one_of(%w(642 643 644 648 649)) >> split(2,2) | # Galcom
|
14
15
|
one_of(%w(33 51 52 54 55 56 57 58 59 68 71 76 78 79 88)) >> split(3,2) |
|
15
16
|
match(/\A(67)\d{5}\z/) >> split(3,2) | # Golis Telecom Somalia
|
17
|
+
match(/\A(63)\d{7}\z/) >> split(3,4) | # Telesom
|
16
18
|
one_of(%w(15 40 42 45 46 60 61 90 91)) >> split(3,3) | # mobile Somafone, Hortel
|
17
19
|
one_of(%w(18)) >> split(3,2) | # Hortel
|
18
20
|
one_of(%w(27 28 29 62 63 87)) >> split(2,2) | # Telcom Somalia, Emir Set
|
19
21
|
one_of(%w(67 69)) >> split(4,3) | # mobile NationLink Telecom
|
20
22
|
one_of('1') >> split(3,3) |
|
21
23
|
fixed(1) >> split(3,3)
|
22
|
-
end
|
24
|
+
end
|
@@ -569,6 +569,8 @@ describe 'country descriptions' do
|
|
569
569
|
describe 'Poland' do
|
570
570
|
it_splits '48123456789', ['48', '12', '345', '67', '89'] # Landline
|
571
571
|
it_splits '48501123456', ['48', '501', '123', '456'] # Mobile
|
572
|
+
it_splits '48571123456', ['48', '571', '123', '456'] # Mobile
|
573
|
+
it_splits '48451123456', ['48', '451', '123', '456'] # Mobile
|
572
574
|
it_splits '48800123456', ['48', '800', '123', '456'] # Free
|
573
575
|
it_splits '48801123456', ['48', '801', '123', '456'] # Shared cost
|
574
576
|
it_splits '48701123456', ['48', '701', '123', '456'] # Premium
|
@@ -1179,12 +1181,14 @@ describe 'country descriptions' do
|
|
1179
1181
|
it_splits '67754692', ['677', false, '54', '692']
|
1180
1182
|
it_splits '6777546921', ['677', false, '7546', '921']
|
1181
1183
|
end
|
1182
|
-
describe '
|
1184
|
+
describe 'Somalia' do
|
1183
1185
|
it_splits '252103412345', %w(252 1034 123 45)
|
1184
1186
|
it_splits '2521313123', %w(252 1313 123)
|
1185
1187
|
it_splits '2521601234', %w(252 160 12 34)
|
1186
1188
|
it_splits '25250012345', %w(252 500 123 45)
|
1187
1189
|
it_splits '252671234567', %w(252 67 1234 567)
|
1190
|
+
it_splits '252634000613', %w(252 63 400 0613)
|
1191
|
+
it_splits '252634423020', %w(252 63 442 3020)
|
1188
1192
|
end
|
1189
1193
|
describe 'Suriname (Republic of)' do
|
1190
1194
|
it_splits '597958434', ['597', false, '958', '434']
|
@@ -48,6 +48,13 @@ describe Phony::CountryCodes do
|
|
48
48
|
it 'normalizes correctly with CC option' do
|
49
49
|
@countries.normalize('044-364-35-32', cc: '41').should eql '41443643532'
|
50
50
|
end
|
51
|
+
|
52
|
+
context 'specific countries' do
|
53
|
+
it 'handles Congo correctly' do
|
54
|
+
@countries.normalize('+242 0571 73992').should eql '242057173992'
|
55
|
+
@countries.normalize('+242 2221 15932').should eql '242222115932'
|
56
|
+
end
|
57
|
+
end
|
51
58
|
end
|
52
59
|
|
53
60
|
describe 'formatted' do
|
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.15.
|
4
|
+
version: 2.15.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-02 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
|