phony 2.16.1 → 2.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/phony/countries/sweden.rb +19 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d831c513f17ed24daad1ad6bd38a46c6b37deb16
4
- data.tar.gz: 304941e9a21b1947471bcf3f2fc6de9dc5294ce7
3
+ metadata.gz: f3ea72c8c92e5024ffb5fccb4e03f176ded23188
4
+ data.tar.gz: 02ac3824d0bd12a5ff74916729f64c2e18feffae
5
5
  SHA512:
6
- metadata.gz: 04743bc50ad6da4c0936878ed2a9eb4b2e560de7e36622e41e741da77a7ddd9e1d9f3893db71113045e68217a69ed71ca5c441b29f47d7f7c69562a910de1ff8
7
- data.tar.gz: 00dc3f70d706c77aa3d31df5306491d01bf1aefd2cb79bc78ef1977ab15b6184d27f470723b7e3254754e727c3b1c831b300bd65a9b302e717456bc95da32578
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
- service = [
47
- '99', # Premium Rate
48
- '112', # Emergency Service
49
- '116', # Psychological Help
50
- '118', # Number enquiries
51
- '900', # Premium Rate
52
- '939', # Premium Rate
53
- '944', # Premium Rate
54
- '1177', # Health Care Advice
55
- '11414', # Police
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
- one_of(service) >> split(3,3) |
62
- one_of(ndcs + mobile) >> matched_split(
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) >> matched_split(
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.1
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-08 00:00:00.000000000 Z
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