phony 2.15.27 → 2.15.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38db83f2fb323c25ec7338913c408d05750d7ad9
4
- data.tar.gz: f8f17fb71c57d268d08915724f40fa7669ea511d
3
+ metadata.gz: 564bbb19f1a422a0f0c4e35adaa6aeaff0058680
4
+ data.tar.gz: d451f370b8e093e0dd3df21fb54f918f5acf18d3
5
5
  SHA512:
6
- metadata.gz: 82b290339b1ca372585f524ba0b034ae342371acd1ad84fac1f742ba2796c185d63f87788906b63a62b5f37b2c0fe51030f48b02730a86fa6846860460b124ca
7
- data.tar.gz: da5b4bd8cf4d77a6f116e559027130341c59cdb3b33c9564b3375ab87149f13003e36e35207d0524e546c5d7427e45c6b9efbe6d00add850193c8b36b03a66e4
6
+ metadata.gz: 0e6b5927b390e7e84e5a577823e853d42ee9514610aa6c713a577c8290b963b80a50d142aa2111b79e6d1bda9619ab72fbc62605c32b1714ef7956a0d7b67fa5
7
+ data.tar.gz: 5894bca88a3ee1cfeb7ccbabbfca7fc5b6d08d942ee4ded3f2ce82081862c723029bac31360206f7d26f08495cdc8b8ecc15d1d3fb5aadf771ef7d705e2439ed
@@ -1090,7 +1090,7 @@ Phony.define do
1090
1090
  one_of('800') >> matched_split(
1091
1091
  /\A\d{2}\z/ => [2],
1092
1092
  /\A\d+\z/ => [2,3,4]) | # freephone
1093
- one_of(%w(50 52 55 56)) >> split(3,4) | # mobile
1093
+ one_of(%w(50 52 54 55 56)) >> split(3,4) | # mobile
1094
1094
  one_of(%w(2 3 4 6 7 9)) >> split(3,4) |
1095
1095
  fixed(1) >> split(3,4)
1096
1096
 
@@ -118,6 +118,7 @@ ndcs_with_7_subscriber_digits = %w(342 343 347 351 383 391 473 495 496 498 499 8
118
118
 
119
119
  Phony.define do
120
120
  country '7',
121
+ # trunk('8', normalize: true, split: true) | # TODO Figure out if this is the way to go.
121
122
  trunk('8', normalize: false) |
122
123
  one_of(ndcs_with_5_subscriber_digits) >> split(1, 2, 2) |
123
124
  one_of(ndcs_with_6_subscriber_digits) >> split(2, 2, 2) |
@@ -25,7 +25,6 @@ ndcs = [
25
25
  '35', # Halmstad
26
26
  '36', # Jönköping-Huskvarna
27
27
  '40', # Malmö
28
- '417', # Tomelilla
29
28
  '42', # Helsingborg-Höganäs
30
29
  '44', # Kristianstad
31
30
  '46', # Lund
@@ -33,8 +32,7 @@ ndcs = [
33
32
  '60', # Sundsvall-Timrå
34
33
  '63', # Östersund
35
34
  '90', # Umeå
36
- '522', # Uddevalla
37
- '77', #Dalarna
35
+ '77', # Dalarna
38
36
  ]
39
37
  mobile = [
40
38
  '70', # Mobile
@@ -62,7 +60,13 @@ Phony.define do
62
60
  trunk('0') |
63
61
  one_of(service) >> split(3,3) |
64
62
  one_of(ndcs + mobile) >> matched_split(
65
- /^\d{5}$/ => [3, 2], /^\d{6}$/ => [2, 2, 2], /^\d{7}$/ => [3, 2, 2], /^\d{8}$/ => [3, 2, 3]
63
+ /^\d{5}$/ => [3, 2],
64
+ /^\d{6}$/ => [2, 2, 2],
65
+ /^\d{7}$/ => [3, 2, 2],
66
+ /^\d{8}$/ => [3, 2, 3]
66
67
  ) |
67
- fixed(3) >> split(3,3,2) # catchall
68
+ fixed(3) >> matched_split(
69
+ /^\d{5}$/ => [3, 2],
70
+ /^\d{6}$/ => [2, 2, 2]
71
+ )
68
72
  end
@@ -229,7 +229,7 @@ describe 'plausibility' do
229
229
  '+211 973 212 345']
230
230
  it_is_correct_for 'Suriname (Republic of)', :samples => ['+597 212 345', '+597 612 3456']
231
231
  it_is_correct_for 'Swaziland', :samples => ['+268 2207 1234', '+268 550 1234']
232
- it_is_correct_for 'Sweden', :samples => ['+46 42 123 45', ['+46 417 123 45', '+46 522 636 365']]
232
+ it_is_correct_for 'Sweden', :samples => ['+46 42 123 45', ['+46 417 123 45', '+46 522 636 365', '+46 513 12 34 56']]
233
233
  it_is_correct_for 'Syrian Arab Republic', :samples => ['+963 11 123 4567',
234
234
  '+963 31 123 4567',
235
235
  '+963 15 731 234',
@@ -308,7 +308,8 @@ describe 'plausibility' do
308
308
  '+971 50 641 2345',
309
309
  '+971 600 641 234',
310
310
  '+971 500 641 234',
311
- '+971 200 641 234']
311
+ '+971 200 641 234',
312
+ '+971 54 999 9999']
312
313
 
313
314
  it_is_correct_for 'United Kingdom', :samples => ['+44 1827 50111'], :invalid_samples => ['+44 0000 123456']
314
315
 
@@ -652,9 +652,10 @@ describe 'country descriptions' do
652
652
  it_splits '46111234567', ['46', '11', '123', '45', '67']
653
653
  it_splits '46721234567', ['46', '72', '123', '45', '67'] # mobile
654
654
  it_splits '46791234567', ['46', '79', '123', '45', '67'] # mobile
655
- it_splits '46125123456', ['46', '125', '123', '456']
655
+ it_splits '46125123456', ['46', '125', '12', '34', '56']
656
656
  it_splits '46770820180', ['46', '77', '082', '01', '80']
657
657
  it_splits '4641712345', ['46', '417', '123', '45']
658
+ it_splits '46513123456', ['46', '513', '12', '34', '56']
658
659
  end
659
660
  describe 'Switzerland' do
660
661
  it_splits '41443643532', ['41', '44', '364', '35', '32'] # Zurich (usually)
@@ -1216,6 +1217,7 @@ describe 'country descriptions' do
1216
1217
  it_splits '971600641234', %w(971 600 641 234)
1217
1218
  it_splits '971500641234', %w(971 500 641 234)
1218
1219
  it_splits '971200641234', %w(971 200 641 234)
1220
+ it_splits '971549999999', %w(971 54 999 9999)
1219
1221
  end
1220
1222
  describe 'Uruguay (Eastern Republic of)' do
1221
1223
  it_splits '59880012345', %w(598 800 123 45)
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.27
4
+ version: 2.15.28
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-07-25 00:00:00.000000000 Z
11
+ date: 2016-08-10 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
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.5.0
113
+ rubygems_version: 2.4.5.1
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Fast international phone number (E164 standard) normalizing, splitting and
@@ -129,4 +129,3 @@ test_files:
129
129
  - spec/lib/phony/national_splitters/none_spec.rb
130
130
  - spec/lib/phony/national_splitters/regex_spec.rb
131
131
  - spec/lib/phony/national_splitters/variable_spec.rb
132
- has_rdoc: false