phony 1.8.3 → 1.8.4
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.
- data/README.textile +1 -1
- data/lib/phony/countries.rb +7 -1
- data/spec/lib/phony/countries_spec.rb +7 -0
- metadata +2 -2
data/README.textile
CHANGED
|
@@ -13,7 +13,7 @@ This gem can normalize, format and split E164 numbers.
|
|
|
13
13
|
|
|
14
14
|
The (admittedly crazy) *goal* of this Gem is to be able to format/split all phone numbers in the world.
|
|
15
15
|
|
|
16
|
-
Currently handles Abhas, Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, Estonian, French, German, Ghanan, Gibraltar, Greek, Hungarian, Italian, Irish, Kazakh, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, and Vietnamese numbers.
|
|
16
|
+
Currently handles Abhas, Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, Estonian, French, German, Ghanan, Gibraltar, Greek, Hungarian, Italian, Irish, Kazakh, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, and Vietnamese numbers.
|
|
17
17
|
|
|
18
18
|
And to some extent, all others. Just try if it works for you.
|
|
19
19
|
|
data/lib/phony/countries.rb
CHANGED
|
@@ -299,7 +299,13 @@ Phony.define do
|
|
|
299
299
|
country '248', todo # Seychelles
|
|
300
300
|
country '249', fixed(2) >> split(3,4) # Sudan
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
# Rwanda
|
|
303
|
+
# http://en.wikipedia.org/wiki/Telephone_numbers_in_Rwanda
|
|
304
|
+
country '250',
|
|
305
|
+
one_of('25') >> split(7) | # Geographic, fixed
|
|
306
|
+
match(/^(7[238])/) >> split(7) | # Non-geographic, mobile
|
|
307
|
+
one_of('06') >> split(6) # Satellite
|
|
308
|
+
|
|
303
309
|
country '251', todo # Ethiopia
|
|
304
310
|
country '252', todo # Somali Democratic Republic
|
|
305
311
|
country '253', todo # Djibouti
|
|
@@ -249,6 +249,13 @@ describe 'country descriptions' do
|
|
|
249
249
|
it_splits '7799121212', ['7', '799', '12', '12', '12'] # Kazachstan
|
|
250
250
|
it_splits '7995344121212', ['7','995344','12','12','12'] # South Osetia
|
|
251
251
|
it_splits '7209175276', ['7', '209', '17', '52', '76'] # Fantasy number
|
|
252
|
+
end
|
|
253
|
+
describe 'Rwanda' do
|
|
254
|
+
it_splits '250781234567', ['250', '78', '1234567'] # mobile
|
|
255
|
+
it_splits '250721234567', ['250', '72', '1234567'] # mobile
|
|
256
|
+
it_splits '250731234567', ['250', '73', '1234567'] # mobile
|
|
257
|
+
it_splits '250251234567', ['250', '25', '1234567'] # fixed
|
|
258
|
+
it_splits '25006123456', ['250', '06', '123456'] # fixed
|
|
252
259
|
end
|
|
253
260
|
describe 'South Korea' do
|
|
254
261
|
it { Phony.split('82212345678').should == ['82', '2', '1234', '5678'] } # Seoul
|
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.8.
|
|
4
|
+
version: 1.8.4
|
|
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-12-04 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
|