phony 2.12.12 → 2.12.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +2 -2
- data/lib/phony/countries.rb +3 -3
- data/spec/functional/plausibility_spec.rb +4 -0
- data/spec/lib/phony/countries_spec.rb +2 -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: c670f516f90acf33d456bc169f72f6b13dbadc6f
|
4
|
+
data.tar.gz: 147c782d3f2d9541a25ada856e1613b747d5eae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12b757a513dd15b85248df13d55fca1109c1875ac1685c3db27746eab522a244c13856b358ce1cdc6be6edbfe24762a4a716a2b426217412c2e0867d644e6568
|
7
|
+
data.tar.gz: df82d33575ec5e2fdde96fd8a2b1564df0f2a5d5388ea2a5fe9c96327650b774fffb53be23d01f6843aecf7d8dff9525379759398804e0db9b3bc7f2b4f73374
|
data/README.textile
CHANGED
@@ -24,7 +24,7 @@ E164 numbers are international numbers with a country dial prefix, usually an ar
|
|
24
24
|
|
25
25
|
Learn more about E164 numbers "here":http://en.wikipedia.org/wiki/E.164.
|
26
26
|
|
27
|
-
Currently handles Abhas, Afghan, Algerian, Argentinan, Austrian, Australian, Azerbaijani, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, El Salvadorian, Estonian, French, German, Ghanan, Gibraltar, Greek, Haiti, Hong Kong, Hungarian, Indian, Iran, Irish, Israel, Italian, Kazakh, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Seychelles, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sri Lankan, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, and
|
27
|
+
Currently handles Abhas, Afghan, Algerian, Argentinan, Austrian, Australian, Azerbaijani, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, El Salvadorian, Estonian, French, German, Ghanan, Gibraltar, Greek, Haiti, Hong Kong, Hungarian, Indian, Iran, Irish, Israel, Italian, Kazakh, Liberian, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Seychelles, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sri Lankan, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, Vietnamese, and Zambian numbers.
|
28
28
|
|
29
29
|
And to some extent, all others. Just try if it works for you.
|
30
30
|
|
@@ -102,7 +102,7 @@ Always use it with a country code, as Phony needs it to know what country to nor
|
|
102
102
|
|
103
103
|
h3(#formatting). Formatting
|
104
104
|
|
105
|
-
Aliased as @Phony.formatted(number_string)@.
|
105
|
+
Aliased as @Phony.formatted(number_string)@.
|
106
106
|
|
107
107
|
You really need to give it a normalized phone number WITH country code, so:
|
108
108
|
|
data/lib/phony/countries.rb
CHANGED
@@ -453,10 +453,10 @@ Phony.define do
|
|
453
453
|
country '259', todo # -
|
454
454
|
|
455
455
|
# Zambia
|
456
|
-
# http://
|
456
|
+
# http://www.wtng.info/wtng-260-zm.html
|
457
457
|
country '260',
|
458
|
-
|
459
|
-
|
458
|
+
match(/^(9(55|66|7[7-9]))/) >> split(6) | # mobile
|
459
|
+
match(/^(21[1-8])/) >> split(6) # fixed
|
460
460
|
|
461
461
|
# Madagascar http://www.wtng.info/wtng-261-mg.html
|
462
462
|
# http://www.itu.int/oth/T020200007F/en
|
@@ -964,6 +964,10 @@ describe 'plausibility' do
|
|
964
964
|
'+967 7 234 567',
|
965
965
|
'+967 77 123 4567',
|
966
966
|
'+967 58 1234']
|
967
|
+
it 'is correct for Zambia' do
|
968
|
+
Phony.plausible?('+260 955 123456').should be_true # mobile
|
969
|
+
Phony.plausible?('+260 211 123456').should be_true # fixed
|
970
|
+
end
|
967
971
|
it_is_correct_for 'Zimbabwe', :samples => [['+263 2582 123 456', '+263 2582 123'],
|
968
972
|
['+263 147 123 456', '+263 147 123'],
|
969
973
|
['+263 270 123 456', '+263 270 123 45'],
|
@@ -696,8 +696,8 @@ describe 'country descriptions' do
|
|
696
696
|
it_splits '84412345678', ['84', '4', '1234', '5678'] # Hanoi
|
697
697
|
end
|
698
698
|
describe 'Zambia' do
|
699
|
-
it_splits '
|
700
|
-
it_splits '
|
699
|
+
it_splits '260955123456', ['260', '955', '123456'] # mobile
|
700
|
+
it_splits '260211123456', ['260', '211', '123456'] # fixed
|
701
701
|
end
|
702
702
|
describe 'New Zealand' do
|
703
703
|
it_splits '6491234567', ['64', '9', '123', '4567']
|
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.13
|
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-04-
|
11
|
+
date: 2015-04-29 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
|