phony 2.12.2 → 2.12.3
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 +4 -4
- data/lib/phony/countries.rb +5 -4
- data/lib/phony/countries/italy.rb +1 -0
- data/spec/functional/plausibility_spec.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04a5f58c6b6d201bb3e281ca88fe53c2a95bbeff
|
|
4
|
+
data.tar.gz: 1327cdf00c24dac5dd9f1e9f7affa8f887c58efe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 772f84fc0f5c6d2d3d21c23f38f6e020ce2a0abb3077b518c99493886b4ccf85aa7706b761e24497eb9e6377ed0e29126b9e9fcb4248fcb344d5e956f2b63325
|
|
7
|
+
data.tar.gz: b7831d7dccc0d103b11965386f76e7c1ab9496380f778c1dc38c81d2850c8edc7b216c701ea471bd6b05af779efc8dc6c72f72d384ceeda8c2e9ab88ca89a197
|
data/lib/phony/countries.rb
CHANGED
|
@@ -44,10 +44,11 @@ Phony.define do
|
|
|
44
44
|
|
|
45
45
|
# Egypt.
|
|
46
46
|
#
|
|
47
|
-
country '20', one_of('800') >> split(7..7) | # Egypt
|
|
48
|
-
one_of('
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
country '20', one_of('800') >> split(7..7) | # Egypt toll free
|
|
48
|
+
one_of('3') >> split(7..7) | # Alexandria
|
|
49
|
+
one_of('2') >> split(8..8) | # Cairo/Giza
|
|
50
|
+
one_of('10', '11', '12') >> split(8..8) | # the 3 mobile operators
|
|
51
|
+
fixed(2) >> split(7..7) # all the other 24 provinces
|
|
51
52
|
|
|
52
53
|
# South Africa.
|
|
53
54
|
#
|
|
@@ -346,8 +346,16 @@ describe 'plausibility' do
|
|
|
346
346
|
Phony.plausible?('+20 800 12345678').should be_false
|
|
347
347
|
Phony.plausible?('+20 2 12345678').should be_true
|
|
348
348
|
Phony.plausible?('+20 2 1234567').should be_false
|
|
349
|
-
Phony.plausible?('+20
|
|
350
|
-
Phony.plausible?('+20
|
|
349
|
+
Phony.plausible?('+20 3 1234567').should be_true
|
|
350
|
+
Phony.plausible?('+20 3 12345678').should be_false
|
|
351
|
+
Phony.plausible?('+20 40 1234567').should be_true
|
|
352
|
+
Phony.plausible?('+20 40 12345678').should be_false
|
|
353
|
+
Phony.plausible?('+20 10 12345678').should be_true
|
|
354
|
+
Phony.plausible?('+20 10 1234567').should be_false
|
|
355
|
+
Phony.plausible?('+20 11 12345678').should be_true
|
|
356
|
+
Phony.plausible?('+20 11 1234567').should be_false
|
|
357
|
+
Phony.plausible?('+20 12 12345678').should be_true
|
|
358
|
+
Phony.plausible?('+20 12 1234567').should be_false
|
|
351
359
|
end
|
|
352
360
|
|
|
353
361
|
it 'is correct for Germany' do
|
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.12.
|
|
4
|
+
version: 2.12.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Hanke
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-03-
|
|
11
|
+
date: 2015-03-18 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
|