phony 2.16.1 → 2.16.2
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 +19 -13
- 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: f3ea72c8c92e5024ffb5fccb4e03f176ded23188
|
4
|
+
data.tar.gz: 02ac3824d0bd12a5ff74916729f64c2e18feffae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c1cae30ad536a2a05150f5417940e4cdd749ac3bb4797f4304b2a491131efe55440024740988c11125f4461c381a41432b3a83f0070454c96d148c75e17879
|
7
|
+
data.tar.gz: 90be70dd85aa56904afbb39d3c611333554a75172064270e1cae5339e987ed311e49e4fc6776069cd58aa7005d4a5c3f617a3c376e9107c25cd4856a4c686378
|
@@ -43,29 +43,35 @@ mobile = [
|
|
43
43
|
'76', # Mobile
|
44
44
|
'79', # Mobile
|
45
45
|
]
|
46
|
-
|
47
|
-
'
|
48
|
-
'
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
'
|
55
|
-
|
46
|
+
services = [
|
47
|
+
'112', # Emergency Service
|
48
|
+
'1177', # Health Care Advice
|
49
|
+
'11414', # Police
|
50
|
+
]
|
51
|
+
service_ndcs = [
|
52
|
+
'99', # Premium Rate
|
53
|
+
'900', # Premium Rate
|
54
|
+
'939', # Premium Rate
|
55
|
+
'944', # Premium Rate
|
56
|
+
]
|
57
|
+
three_digit_service = [
|
58
|
+
'116', # Psychological Help (116 xxx)
|
59
|
+
'118', # Number enquiries (118 xxx)
|
56
60
|
]
|
57
61
|
|
58
62
|
Phony.define do
|
59
63
|
country '46',
|
60
64
|
trunk('0') |
|
61
|
-
|
62
|
-
one_of(
|
65
|
+
match(/^(#{services.join('|')})$/) >> split(0) |
|
66
|
+
one_of(service_ndcs) >> split(3,3) |
|
67
|
+
match(/^(#{three_digit_service.join('|')})\d{3}$/) >> split(3) |
|
68
|
+
one_of(ndcs + mobile) >> matched_split(
|
63
69
|
/^\d{5}$/ => [3, 2],
|
64
70
|
/^\d{6}$/ => [2, 2, 2],
|
65
71
|
/^\d{7}$/ => [3, 2, 2],
|
66
72
|
/^\d{8}$/ => [3, 2, 3]
|
67
73
|
) |
|
68
|
-
fixed(3)
|
74
|
+
fixed(3) >> matched_split(
|
69
75
|
/^\d{5}$/ => [3, 2],
|
70
76
|
/^\d{6}$/ => [2, 2, 2]
|
71
77
|
)
|
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.16.
|
4
|
+
version: 2.16.2
|
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-12-
|
11
|
+
date: 2017-12-22 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
|