phony 2.15.20 → 2.15.21
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/sweden.rb +26 -25
- data/spec/functional/plausibility_spec.rb +1 -1
- data/spec/lib/phony/countries_spec.rb +1 -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: 8312672523b7c449e514201c22bd2439d07ff9ea
|
4
|
+
data.tar.gz: eedbde9682f73690b61c1580afe115ae301f58b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0974c54772cfbec9eab7bb58113db3b5d78e4a43724b18144a189a9f29f618bdb2810c13e5f45d6b51a424af5b668c45d62cce8fa1babf9be3010056894754b0
|
7
|
+
data.tar.gz: cecf1398dd7150eabb3979af95562a5558e0dcc5f78dc20b32ccc5fc8d610a1708aeccf777d1b348eb93045ddb1632ddfb12a536ba7f660993d8a376f30e404e
|
@@ -9,31 +9,32 @@
|
|
9
9
|
|
10
10
|
ndcs = [
|
11
11
|
# '7', # Non-geographic - conflicts with mobile
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
'
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
12
|
+
'8', # Stockholm
|
13
|
+
'10', # VOIP
|
14
|
+
'11', # Norrköping
|
15
|
+
'13', # Linköping
|
16
|
+
'16', # Eskilstuna-Torshälla
|
17
|
+
'18', # Uppsala
|
18
|
+
'19', # Örebro-Kumla
|
19
|
+
'20', # toll-free
|
20
|
+
'21', # Västerås
|
21
|
+
'23', # Falun
|
22
|
+
'26', # Gävle-Sandviken
|
23
|
+
'31', # Göteborg
|
24
|
+
'33', # Borås
|
25
|
+
'35', # Halmstad
|
26
|
+
'36', # Jönköping-Huskvarna
|
27
|
+
'40', # Malmö
|
28
|
+
'417', # Tomelilla
|
29
|
+
'42', # Helsingborg-Höganäs
|
30
|
+
'44', # Kristianstad
|
31
|
+
'46', # Lund
|
32
|
+
'54', # Karlstad
|
33
|
+
'60', # Sundsvall-Timrå
|
34
|
+
'63', # Östersund
|
35
|
+
'90', # Umeå
|
35
36
|
'522', # Uddevalla
|
36
|
-
|
37
|
+
'77', #Dalarna
|
37
38
|
]
|
38
39
|
mobile = [
|
39
40
|
'70', # Mobile
|
@@ -61,7 +62,7 @@ Phony.define do
|
|
61
62
|
trunk('0') |
|
62
63
|
one_of(service) >> split(3,3) |
|
63
64
|
one_of(ndcs + mobile) >> matched_split(
|
64
|
-
/^\d{6}$/ => [2, 2, 2], /^\d{7}$/ => [3, 2, 2], /^\d{8}$/ => [3, 2, 3]
|
65
|
+
/^\d{5}$/ => [3, 2], /^\d{6}$/ => [2, 2, 2], /^\d{7}$/ => [3, 2, 2], /^\d{8}$/ => [3, 2, 3]
|
65
66
|
) |
|
66
67
|
fixed(3) >> split(3,3,2) # catchall
|
67
68
|
end
|
@@ -228,7 +228,7 @@ describe 'plausibility' do
|
|
228
228
|
'+211 973 212 345']
|
229
229
|
it_is_correct_for 'Suriname (Republic of)', :samples => ['+597 212 345', '+597 612 3456']
|
230
230
|
it_is_correct_for 'Swaziland', :samples => ['+268 2207 1234', '+268 550 1234']
|
231
|
-
it_is_correct_for 'Sweden', :samples => ['+46 522 636 365']
|
231
|
+
it_is_correct_for 'Sweden', :samples => ['+46 42 123 45', ['+46 417 123 45', '+46 522 636 365']]
|
232
232
|
it_is_correct_for 'Syrian Arab Republic', :samples => ['+963 11 123 4567',
|
233
233
|
'+963 31 123 4567',
|
234
234
|
'+963 15 731 234',
|
@@ -643,6 +643,7 @@ describe 'country descriptions' do
|
|
643
643
|
it_splits '46791234567', ['46', '79', '123', '45', '67'] # mobile
|
644
644
|
it_splits '46125123456', ['46', '125', '123', '456']
|
645
645
|
it_splits '46770820180', ['46', '77', '082', '01', '80']
|
646
|
+
it_splits '4641712345', ['46', '417', '123', '45']
|
646
647
|
end
|
647
648
|
describe 'Switzerland' do
|
648
649
|
it_splits '41443643532', ['41', '44', '364', '35', '32'] # Zurich (usually)
|
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.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-06 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
|