phony 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Ghanan, Greek, Hungarian, Italian, Irish, Kazakh, Lithuanian, Luxembourgian, Malaysian, Mexican, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, and Vietnamese numbers.
16
+ Currently handles Abhas, Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Ghanan, Greek, Hungarian, Italian, Irish, Kazakh, Lithuanian, Luxembourgian, Malaysian, Mexican, 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.
17
17
  And to some extent, all others. Just try if it works for you.
18
18
 
19
19
  If it doesn't, please "enter an issue":http://github.com/floere/phony/issues.
@@ -242,7 +242,7 @@ Phony.define do
242
242
 
243
243
  country '210', todo # -
244
244
  country '211', todo # South Sudan
245
- country '212', todo # Morocco
245
+ country '212', fixed(2) >> split(4,3) # Morocco
246
246
  country '213', fixed(2) >> split(3,4) # Algeria
247
247
  country '214', todo # -
248
248
  country '215', todo # -
@@ -297,7 +297,7 @@ Phony.define do
297
297
  country '246', todo # Diego Garcia
298
298
  country '247', none >> split(4) # Ascension
299
299
  country '248', todo # Seychelles
300
- country '249', todo # Sudan
300
+ country '249', fixed(2) >> split(3,4) # Sudan
301
301
 
302
302
  country '250', todo # Rwanda
303
303
  country '251', todo # Ethiopia
@@ -160,6 +160,9 @@ describe 'country descriptions' do
160
160
  it_splits '525512121212', ['52', '55', '12', '12', '12', '12'] # Mexico City
161
161
  it_splits '526641231212', ['52', '664', '123', '12', '12'] # Tijuana
162
162
  end
163
+ describe 'Morocco' do
164
+ it_splits '212537718685', ['212', '53', '7718', '685']
165
+ end
163
166
  describe 'The Netherlands' do
164
167
  it_splits '31612345678', ['31', '6', '12345678'] # mobile
165
168
  it_splits '31201234567', ['31', '20', '1234567']
@@ -212,6 +215,9 @@ describe 'country descriptions' do
212
215
  it { Phony.split('821027975588').should == ['82', '10', '2797', '5588'] } # mobile
213
216
  it { Phony.split('821087971234').should == ['82', '10', '8797', '1234'] } # mobile
214
217
  end
218
+ describe 'Sudan' do
219
+ it_splits '249187171100', ['249', '18', '717', '1100']
220
+ end
215
221
  describe 'Thailand' do
216
222
  it { Phony.split('6621231234').should == ['66', '2', '123', '1234'] } # Bangkok
217
223
  it { Phony.split('6636123123').should == ['66', '36', '123', '123'] } # Lop Buri
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.0
4
+ version: 1.8.1
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-08-30 00:00:00.000000000 Z
12
+ date: 2012-09-11 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