phony 2.8.4 → 2.8.5

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: 5b20a704d057c3295d795f4dfcf235a5bf2b1220
4
- data.tar.gz: fb1ffb2faf783720497b8d3f758edd0183f2bc7e
3
+ metadata.gz: ddd6173b7d716c058faa71d0ea7a4d088b489bc0
4
+ data.tar.gz: 21cc4457bf280d3c4bbca640b976de2a695532ee
5
5
  SHA512:
6
- metadata.gz: 3abcaf915fec92569f7ea4c74d72aa76e685341dafeeb238c0434d9a05e22c30ce787e965bc0b79a050e074c672dc7bf0fa9686c8fe852d94662bbd564423a70
7
- data.tar.gz: 4dca85b010dc5009d7e698fb325d785781546096f2943887ffaf203d9e4791c3d123abebcf1a3e2540a9ee039ac4649a2be9546a90c1ac7f9179f6ca7deaa304
6
+ metadata.gz: e14dd407726870e5cbcbc1ce07ed384bf9b6a15b91d0aa31349d0916c98de54407344b3f9b6cc68d9aaea915eb90b78b7c57a5a0c201119a62d0c5fbeedd6a25
7
+ data.tar.gz: 2d71adbb380bee99f155f75b4f46517005553330985a5aadb906bc5ccab034c02aab30e6c263ed96a5351e114fc3764aa74f03362a925718e38261cb58519561
@@ -4084,7 +4084,7 @@ service = [
4084
4084
  Phony.define do
4085
4085
  country '49',
4086
4086
  trunk('0', normalize: true) |
4087
- one_of(*service) >> split(3,4) |
4087
+ one_of(*service) >> split(3,1..9) |
4088
4088
  one_of(*mobile_4digits) >> split(3,4) |
4089
4089
  one_of(*mobile_3digits) >> split(4,3..4) |
4090
4090
  one_of(*ndcs2) >> split(3,2..10) |
@@ -368,6 +368,12 @@ describe 'plausibility' do
368
368
  Phony.plausible?('+49 800 1234567').should be_true
369
369
  Phony.plausible?('+49 1805 878323').should be_true
370
370
 
371
+ # Extended service numbers
372
+ # http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Rufnummern/0800/0800_Nummernplan.pdf?__blob=publicationFile&v=1
373
+ Phony.plausible?('+49 800 222 3400 10').should be_true
374
+ Phony.plausible?('+49 800 222 3400 100').should be_true
375
+ Phony.plausible?('+49 800 222 3400 1000').should be_false
376
+
371
377
  # Following tests implement specifications from
372
378
  # http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Rufnummern/ONRufnr/NummernplanOrtsnetzrufnummern.pdf?__blob=publicationFile&v=2 (04.24.2014)
373
379
  # Page 3
@@ -215,22 +215,23 @@ describe 'country descriptions' do
215
215
  it_splits '995596123456', %w(995 596 123 456)
216
216
  end
217
217
  describe 'Germany' do
218
- it_splits '493038625454', ['49', '30', '386', '25454'] # Berlin
219
- it_splits '4932221764542', ['49', '32', '221', '764542'] # Non-Geographical
220
- it_splits '4922137683323', ['49', '221', '376', '83323'] # Cologne
221
- it_splits '497614767676', ['49', '761', '476', '7676'] # Freiburg im Breisgau
222
- it_splits '4921535100', ['49', '2153', '510', '0'] # Nettetal-Lobberich
223
- it_splits '493434144602', ['49', '34341', '446', '02'] # Geithain
218
+ it_splits '493038625454', ['49', '30', '386', '25454'] # Berlin
219
+ it_splits '4932221764542', ['49', '32', '221', '764542'] # Non-Geographical
220
+ it_splits '4922137683323', ['49', '221', '376', '83323'] # Cologne
221
+ it_splits '497614767676', ['49', '761', '476', '7676'] # Freiburg im Breisgau
222
+ it_splits '4921535100', ['49', '2153', '510', '0'] # Nettetal-Lobberich
223
+ it_splits '493434144602', ['49', '34341', '446', '02'] # Geithain
224
224
 
225
- it_splits '491805878323', ['49', '180', '587', '8323'] # Service number
226
- it_splits '491815878323', ['49', '181', '587', '8323'] # Service number
227
- it_splits '498001234567', ['49', '800', '123', '4567'] # Service number
225
+ it_splits '491805878323', ['49', '180', '587', '8323'] # Service number
226
+ it_splits '491815878323', ['49', '181', '587', '8323'] # Service number
227
+ it_splits '498001234567', ['49', '800', '123', '4567'] # Service number
228
+ it_splits '49800222340010', ['49', '800', '222', '340010'] # Service number
228
229
 
229
- it_splits '4915111231234', ['49', '151', '1123', '1234'] # Mobile number
230
- it_splits '4915771231234', ['49', '157', '7123', '1234'] # Mobile number
231
- it_splits '491601234567', ['49', '160', '1234', '567'] # Mobile number
232
- it_splits '4916312345678', ['49', '163', '1234', '5678'] # Mobile number
233
- it_splits '4915211231234', ['49', '1521', '123', '1234'] # Mobile number
230
+ it_splits '4915111231234', ['49', '151', '1123', '1234'] # Mobile number
231
+ it_splits '4915771231234', ['49', '157', '7123', '1234'] # Mobile number
232
+ it_splits '491601234567', ['49', '160', '1234', '567'] # Mobile number
233
+ it_splits '4916312345678', ['49', '163', '1234', '5678'] # Mobile number
234
+ it_splits '4915211231234', ['49', '1521', '123', '1234'] # Mobile number
234
235
  end
235
236
  describe 'Ghana' do
236
237
  it_splits '233302123456', ['233', '30', '212', '3456'] # Mobile Vodafone, Accra
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.8.4
4
+ version: 2.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2014-12-03 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