phony 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/lib/phony/countries.rb +7 -1
- data/spec/lib/phony/countries_spec.rb +3 -0
- metadata +2 -2
data/README.textile
CHANGED
@@ -9,7 +9,7 @@ This gem can normalize, format and split E164 numbers.
|
|
9
9
|
|
10
10
|
The (admittedly crazy) *goal* of this Gem is to be able to format/split all phone numbers in the world.
|
11
11
|
|
12
|
-
Currently handles Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Greek, Hungarian, Italian, Ireland, Lithuanian, Malaysian, Mexican, (The) Netherlands, New Zealand, Norwegian, Peruvian, Polish, Russian, Romanian, Singapore, Slovakian, South African, South Korean, Spanish, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, and Venezuelan numbers.
|
12
|
+
Currently handles Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Ghanan, Greek, Hungarian, Italian, Ireland, Lithuanian, Malaysian, Mexican, (The) Netherlands, New Zealand, Norwegian, Peruvian, Polish, Russian, Romanian, Singapore, Slovakian, South African, South Korean, Spanish, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, and Venezuelan numbers.
|
13
13
|
And to some extent, all others. Just try if it works for you.
|
14
14
|
|
15
15
|
If it doesn't, please "enter an issue":http://github.com/floere/phony/issues.
|
data/lib/phony/countries.rb
CHANGED
@@ -234,7 +234,13 @@ Phony.define do
|
|
234
234
|
country '230', todo # Mauritius
|
235
235
|
country '231', todo # Liberia
|
236
236
|
country '232', todo # Sierra Leone
|
237
|
-
|
237
|
+
|
238
|
+
# Ghana
|
239
|
+
#
|
240
|
+
# From http://www.itu.int/oth/T0202000052/en
|
241
|
+
#
|
242
|
+
country '233', fixed(2) >> split(3,4)
|
243
|
+
|
238
244
|
country '234', todo # Nigeria
|
239
245
|
country '235', todo # Chad
|
240
246
|
country '236', todo # Central African Republic
|
@@ -94,6 +94,9 @@ describe 'country descriptions' do
|
|
94
94
|
Phony.split('491805878323').should == ['49', '180', '587', '8323'] # Service numbers
|
95
95
|
Phony.split('491815878323').should == ['49', '181', '587', '8323'] # Service numbers
|
96
96
|
end
|
97
|
+
it 'handles ghanese numbers' do
|
98
|
+
Phony.split('233302123456').should == ['233', '30', '212', '3456'] # Mobile Vodafone, Accra
|
99
|
+
end
|
97
100
|
it 'handles greek numbers' do
|
98
101
|
Phony.split('3021123456').should == ['30', '21', '123456'] # Athens
|
99
102
|
Phony.split('3069512345').should == ['30', '695', '12345'] # Mobile
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'Fast international phone number (E164 standard) normalizing, splitting
|
15
15
|
and formatting. Lots of formatting options: International (+.., 00..), national
|