phony 1.6.7 → 1.6.8
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/lib/phony/countries.rb +5 -1
- data/spec/lib/phony/countries_spec.rb +5 -0
- metadata +2 -2
data/lib/phony/countries.rb
CHANGED
@@ -212,7 +212,11 @@ Phony.define do
|
|
212
212
|
|
213
213
|
# country '82' # SouthKorea, see special file.
|
214
214
|
|
215
|
-
country '84',
|
215
|
+
country '84', # Viet Nam (Socialist Republic of)
|
216
|
+
one_of('4', '8') >> split(7) |
|
217
|
+
match(/^(2[025679]|3[0136789]|5[23456789]|6[01234678]|7[02345679]|9[0-8])\d/) >> split(6) |
|
218
|
+
fixed(3) >> split(5)
|
219
|
+
|
216
220
|
|
217
221
|
# country '86' # China, see special file.
|
218
222
|
|
@@ -238,6 +238,11 @@ describe 'country descriptions' do
|
|
238
238
|
it 'handles venezuelan numbers' do
|
239
239
|
Phony.split('582121234567').should == ['58', '212', '1234567']
|
240
240
|
end
|
241
|
+
it 'handles vietnamese numbers' do
|
242
|
+
Phony.split('8498123456').should == ['84', '98', '123456'] # Viettel Mobile
|
243
|
+
Phony.split('8499612345').should == ['84', '996', '12345'] # GTel
|
244
|
+
Phony.split('8441234567').should == ['84', '4', '1234567'] # Hanoi
|
245
|
+
end
|
241
246
|
it 'handles new zealand numbers' do
|
242
247
|
Phony.split('6491234567').should == ['64', '9', '123', '4567']
|
243
248
|
end
|
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.8
|
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-05-13 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
|