phony 2.2.5 → 2.2.7
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 +8 -8
- data/lib/phony/countries/germany.rb +12 -11
- data/spec/functional/plausibility_spec.rb +25 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmYyM2E1MmVmYTM2OTE0YzIyM2U2MzE4YWY1MTMxMTdjYTQ0ZDU5OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjgyODQ1OGVhZjFkNDI0OWVjOWNiYjhkMzJhOThhOGZkYzUxMDZjNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTI5ZGNhOGYwM2YyYTljNTU2OGZmNmMyMWE2MDE5NzY0YjYwM2E0ZTQ2OWYz
|
10
|
+
ZmE0NmJhZGU0NThiODc3ZGI0MjgxNTBlNjAwMzgzMjc0NTE4OGQwYjhmMzgw
|
11
|
+
NTYxOWU0MDI0MmYzYmM0OWMyMDFiNTBmNDUzZTNiZGE3MDc2NTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTkyY2I5YmNhNzhmZDRlY2RmMzRmNzVhNjYzNjAxOTc5MDMyNTVlNzQzMzY3
|
14
|
+
ZDU2NDIwYzcxOTE5YmJjMTk5NGJmMWY2N2UzNjM1NDVlY2U4OTcyNzI3YzBh
|
15
|
+
MDY0YWJmNDM3MWM3ZTcxZTkwOWNkNjAwZGU5MDE3MTcxZWE1ZmI=
|
@@ -4073,17 +4073,18 @@ service = [
|
|
4073
4073
|
# http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000510001PDFE.pdf
|
4074
4074
|
# "Numbers assigned in the past, which are generally grandfathered, may be as short as five digits."
|
4075
4075
|
#
|
4076
|
-
|
4076
|
+
# http://www.bundesnetzagentur.de/cln_1911/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Nummerierungskonzept/nummerierungskonzept_node.html
|
4077
|
+
#
|
4078
|
+
# TODO Define lower end of last part correctly.
|
4079
|
+
#
|
4077
4080
|
Phony.define do
|
4078
4081
|
country '49',
|
4079
|
-
one_of(service) >> split(3,0)
|
4080
|
-
one_of('176') >> split(3,5) |
|
4081
|
-
one_of('1609') >> split(3,5) |
|
4082
|
+
one_of(service) >> split(3,0) |
|
4082
4083
|
match(/\A(151[124567]|152[012359]|157[035789]|1590)\d*\z/) >> split(3,4) |
|
4083
|
-
match(/\A(
|
4084
|
-
match(/\A(
|
4085
|
-
one_of(ndcs2) >> split(3,
|
4086
|
-
one_of(ndcs3) >> split(3,
|
4087
|
-
one_of(ndcs4) >> split(3,0..
|
4088
|
-
fixed(5) >> split(3,
|
4089
|
-
end
|
4084
|
+
match(/\A(15\d)\d*\z/) >> split(3,4) |
|
4085
|
+
match(/\A(1[67]\d)\d*\z/) >> split(3,1..5) | # Seite 49 [?]
|
4086
|
+
one_of(ndcs2) >> split(3,2..10) | # 5-9 Stellen nach Seite 32 [?]
|
4087
|
+
one_of(ndcs3) >> split(3,1..9) |
|
4088
|
+
one_of(ndcs4) >> split(3,0..8) |
|
4089
|
+
fixed(5) >> split(3,0..7)
|
4090
|
+
end
|
@@ -292,16 +292,38 @@ describe 'plausibility' do
|
|
292
292
|
Phony.plausible?('+49 209 169 - 3530').should be_true # Gelsenkirchen
|
293
293
|
Phony.plausible?('+49 40 123 45678').should be_true
|
294
294
|
Phony.plausible?('+49 40 123 456789').should be_true # TODO ?
|
295
|
+
Phony.plausible?('+49 160 123 1234').should be_true # Mobile Number 7 digits
|
296
|
+
Phony.plausible?('+49 160 123 12345').should be_true # Mobile Number 8 digits
|
295
297
|
Phony.plausible?('+49 171 123 4567').should be_true
|
296
|
-
Phony.plausible?('+49 171 123 45678').should
|
298
|
+
Phony.plausible?('+49 171 123 45678').should be_true # is a valid number according German authority "bundesnetzagentur": http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Rufnummern/ONRufnr/NummernplanOrtsnetzrufnummern.pdf?__blob=publicationFile&v=2 (04.24.2014)
|
297
299
|
Phony.plausible?('+49 177 123 1234').should be_true
|
298
300
|
Phony.plausible?('+49 176 123 12345').should be_true
|
299
301
|
Phony.plausible?('+49 991 1234').should be_true # stricter 3 digit ndc rules
|
300
302
|
Phony.plausible?('+49 2041 123').should be_true # Grandfathered numbers.
|
301
303
|
Phony.plausible?('+49 2041 1234567').should be_true
|
302
|
-
Phony.plausible?('+49 2041 12345689').should be_false # Could be a call-through number
|
303
304
|
Phony.plausible?('+49 31234 123456').should be_true
|
304
|
-
Phony.plausible?('+49
|
305
|
+
Phony.plausible?('+49 7141 12345670').should be_true
|
306
|
+
Phony.plausible?('+49 1609 1234567').should be_true # Bug: https://github.com/floere/phony/issues/146
|
307
|
+
# Following tests implement specifications from
|
308
|
+
# http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Rufnummern/ONRufnr/NummernplanOrtsnetzrufnummern.pdf?__blob=publicationFile&v=2 (04.24.2014)
|
309
|
+
# Page 3
|
310
|
+
Phony.plausible?('+49 89 12345678').should be_true # NZ-E
|
311
|
+
Phony.plausible?('+49 89 123456789').should be_true # NZ-E & NZ-Z
|
312
|
+
Phony.plausible?('+49 89 1234567890').should be_true # NZ-Z
|
313
|
+
Phony.plausible?('+49 209 1234567').should be_true # NZ-E
|
314
|
+
Phony.plausible?('+49 209 12345678').should be_true # NZ-E & NZ-Z
|
315
|
+
Phony.plausible?('+49 209 123456789').should be_true # NZ-Z
|
316
|
+
Phony.plausible?('+49 6421 123456').should be_true # NZ-E
|
317
|
+
Phony.plausible?('+49 6421 1234567').should be_true # NZ-E & NZ-Z
|
318
|
+
Phony.plausible?('+49 6421 12345678').should be_true # NZ-Z
|
319
|
+
Phony.plausible?('+49 33053 12345').should be_true # NZ-E
|
320
|
+
Phony.plausible?('+49 33053 123456').should be_true # NZ-E & NZ-Z
|
321
|
+
Phony.plausible?('+49 33053 1234567').should be_true # NZ-Z
|
322
|
+
# Point 2.3c) Numbers can be up to 13 Digits long without prefix according to E.164
|
323
|
+
Phony.plausible?('+49 33053 12345678').should be_true
|
324
|
+
Phony.plausible?('+49 6421 123456789').should be_true
|
325
|
+
Phony.plausible?('+49 209 1234567890').should be_true
|
326
|
+
Phony.plausible?('+49 40 12345678901').should be_true
|
305
327
|
end
|
306
328
|
|
307
329
|
it 'is correct for Israelian numbers' do
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.7
|
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-04-
|
11
|
+
date: 2014-04-27 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
|
15
|
-
(0..), and local
|
15
|
+
(0..), and local.'
|
16
16
|
email: florian.hanke+phony@gmail.com
|
17
17
|
executables: []
|
18
18
|
extensions: []
|