phony 2.15.20 → 2.15.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80c3cd9ec064cea03c0a9be28d5b119a70a8b60e
4
- data.tar.gz: 786121b9ec8465a6a5767c5b47c793d4d918626d
3
+ metadata.gz: 8312672523b7c449e514201c22bd2439d07ff9ea
4
+ data.tar.gz: eedbde9682f73690b61c1580afe115ae301f58b3
5
5
  SHA512:
6
- metadata.gz: 315fdfbf53096487118204e4918b65e64510ae444bbb8d84bc57c294fb42a29333d3372dea33e7347b863b30027db3d2939fe9f3eec4260af05abfab459e503e
7
- data.tar.gz: 270f784d5596acc5d11d5364737171125a1df8abaee71934b62990a8c00a777b3747660cce26af9ad7dcd4734b433872d6dfbbc61f1a122743faedbe2159309f
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
- '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
- '42', # Helsingborg-Höganäs
29
- '44', # Kristianstad
30
- '46', # Lund
31
- '54', # Karlstad
32
- '60', # Sundsvall-Timrå
33
- '63', # Östersund
34
- '90', # Umeå
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
- '77', #Dalarna
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.20
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-01 00:00:00.000000000 Z
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