phonie 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+
3
+ before_install: gem install bundler
4
+ before_script: export RUBY_GC_MALLOC_LIMIT=90000000
5
+
6
+ rvm:
7
+ - 1.8.7
8
+ - 1.9.2
9
+ - 1.9.3
10
+ - 2.0.0
11
+ - rbx-18mode
12
+ - rbx-19mode
13
+ - ruby-head
14
+
15
+ script: rake
@@ -91,6 +91,7 @@ Currently tested on:
91
91
  [BA] Bosnia and Herzegovina
92
92
  [BD] Bangladesh
93
93
  [BE] Belgium
94
+ [BF] Burkina Faso
94
95
  [BG] Bulgaria
95
96
  [BH] Bahrain
96
97
  [BO] Bolivia
@@ -117,6 +118,7 @@ Currently tested on:
117
118
  [FR] France
118
119
  [GB] United Kingdom
119
120
  [GE] Georgia
121
+ [GF] French Guiana
120
122
  [GH] Ghana
121
123
  [GR] Greece
122
124
  [GT] Guatemala
@@ -127,14 +129,22 @@ Currently tested on:
127
129
  [IE] Ireland
128
130
  [IL] Israel
129
131
  [IN] India
132
+ [IQ] Iraq
130
133
  [IR] Iran
131
134
  [IT] Italy
135
+ [JP] Japan
132
136
  [KE] Kenya
137
+ [KR] South Korea
138
+ [KW] Kuwait
133
139
  [LK] Sri Lanka
134
140
  [LT] Lithuania
135
141
  [LU] Luxembourg
136
142
  [LV] Latvia
143
+ [MA] Morocco
144
+ [MT] Malta
145
+ [MX] Mexico
137
146
  [NG] Nigeria
147
+ [NI] Nicaragua
138
148
  [NL] Netherlands
139
149
  [NO] Norway
140
150
  [NP] Nepal
@@ -148,11 +158,15 @@ Currently tested on:
148
158
  [SA] Saudi Arabia
149
159
  [SE] Sweden
150
160
  [SI] Slovenia
161
+ [SK] Slovakia
162
+ [SN] Senegal
151
163
  [SV] El Salvador
152
164
  [TO] Tonga
165
+ [TW] Taiwan
153
166
  [UA] Ukraine
154
167
  [US] United States
155
168
  [UY] Uruguay
169
+ [VN] Vietnam
156
170
  [ZA] South Africa
157
171
  [ZW] Zimbabwe
158
172
 
@@ -50,6 +50,17 @@
50
50
  :iso_3166_code: GP
51
51
  :name: Guadeloupe
52
52
  :international_dialing_prefix: '00'
53
+ -
54
+ :country_code: '81'
55
+ :national_dialing_prefix: '0'
56
+ :char_2_code: '0'
57
+ :iso_3166_code: JP
58
+ :name: Japan
59
+ :international_dialing_prefix: '010'
60
+ :area_code: '8514|8512|8477|8396|8388|8387|1267|9496|7468|5979|5769|4998|1372|1374|1377|4996|4994|1392|1397|1398|4992|9802|9912|9913|1456|1457|1658|1466|9969|1656|1655|1654|1547|1648|1558|1635|1564|1634|1632|1586|1587|984|163|158|157|156|164|155|165|154|153|152|146|166|167|996|172|173|174|175|176|178|179|995|182|183|184|185|186|187|994|191|192|193|194|195|197|198|993|145|220|223|224|225|226|228|229|144|233|234|235|237|238|990|240|241|242|243|244|246|896|248|987|250|254|255|256|257|258|259|986|260|261|263|264|265|266|267|268|269|985|270|274|276|277|278|279|162|280|282|283|284|285|287|288|289|983|291|293|294|295|296|297|299|982|143|980|422|428|979|436|438|439|978|977|974|460|463|465|466|467|973|470|475|476|478|479|972|480|969|493|494|495|142|139|138|137|968|967|966|531|532|533|536|537|538|539|965|544|545|547|548|964|550|551|553|554|555|556|557|558|561|562|563|564|565|566|567|568|569|570|572|573|574|575|576|136|577|578|959|581|584|585|586|587|957|594|595|596|597|135|598|599|956|955|954|952|721|725|950|735|736|737|738|739|740|742|743|744|745|746|134|747|748|749|133|949|761|763|765|766|767|768|948|770|771|772|773|774|776|778|779|947|946|790|791|794|795|796|797|798|799|944|800|943|820|823|824|826|827|829|942|833|834|835|836|837|838|126|125|124|940|845|846|847|123|848|120|997|852|853|854|855|856|857|858|859|930|863|865|866|867|868|869|920|875|877|879|898|880|883|884|885|887|889|897|892|893|894|895|247|89|88|90|92|87|93|86|84|83|82|80|79|78|77|76|75|95|73|72|70|60|15|59|58|96|55|54|53|18|50|49|97|48|47|46|45|44|43|98|42|17|11|29|28|27|26|25|99|24|23|22|20|19|52|4|6|3'
61
+ :local_number_format: '\d{4,8}'
62
+ :mobile_format: '(80|90)(?:[1-9]\d{7})'
63
+ :number_format: '\d{8,13}'
53
64
  -
54
65
  :country_code: '82'
55
66
  :national_dialing_prefix: '0'
@@ -58,9 +69,9 @@
58
69
  :name: Korea, Republic of
59
70
  :international_dialing_prefix: '001'
60
71
  :area_code: 1[0-9]|2|3[0-3]|4[1-49]|5[0-5]|6[0-4]|70|8[0-8]
61
- :local_number_format: \d{7}
62
- :mobile_format: 1\d{8}
63
- :number_format: 2\d{7}|\d{9}
72
+ :local_number_format: \d{7,8}
73
+ :mobile_format: 1\d{8,9}
74
+ :number_format: 2\d{7}|\d{9,10}
64
75
  -
65
76
  :country_code: '223'
66
77
  :national_dialing_prefix: '0'
@@ -100,6 +111,10 @@
100
111
  :iso_3166_code: SK
101
112
  :name: Slovakia
102
113
  :international_dialing_prefix: '00'
114
+ :area_code: '9|2|3[1-8]|4[1-8]|5[1-8]'
115
+ :local_number_format: '\d{8}'
116
+ :number_format: '\d{9,10}'
117
+ :mobile_format: '9\d{8}'
103
118
  -
104
119
  :country_code: '507'
105
120
  :national_dialing_prefix: None
@@ -132,6 +147,10 @@
132
147
  :iso_3166_code: VN
133
148
  :name: Viet Nam
134
149
  :international_dialing_prefix: '00'
150
+ :area_code: '199|188|186|169|168|167|166|165|164|163|129|128|127|126|125|996|123|122|121|120|999|998|124|710|281|280|711|780|781|241|240|231|230|650|219|218|211|210|321|320|350|351|511|510|501|500|651|98|31|30|70|59|58|57|56|55|54|53|52|36|37|38|90|91|92|93|94|95|96|97|20|39|68|67|66|29|22|64|63|62|61|60|79|25|26|77|76|75|74|73|72|27|33|4'
151
+ :mobile_format: '(199|188|186|169|168|167|166|165|164|163|129|128|127|126|125|996|123|122|121|120|999|998|124|98|97|96|95|94|93|92|91|90)\d{7}'
152
+ :local_number_format: '\d{5,8}'
153
+ :number_format: '\d{6,11}'
135
154
  -
136
155
  :country_code: '678'
137
156
  :national_dialing_prefix: None
@@ -218,6 +237,10 @@
218
237
  :iso_3166_code: HT
219
238
  :name: Haiti
220
239
  :international_dialing_prefix: '00'
240
+ :area_code: \d{2}
241
+ :number_format: \d{8}
242
+ :local_number_format: \d{6}
243
+ :mobile_format: '((3[2-9]|4\d)\d{6})'
221
244
  -
222
245
  :country_code: '593'
223
246
  :national_dialing_prefix: '0'
@@ -247,6 +270,10 @@
247
270
  :iso_3166_code: BF
248
271
  :name: Burkina Faso
249
272
  :international_dialing_prefix: '00'
273
+ :area_code: '\d{2}'
274
+ :local_number_format: '\d{6}'
275
+ :number_format: '\d{8}'
276
+ :mobile_format: '7\d{7}'
250
277
  -
251
278
  :country_code: '423'
252
279
  :national_dialing_prefix: None
@@ -275,6 +302,10 @@
275
302
  :iso_3166_code: GF
276
303
  :name: French Guiana
277
304
  :international_dialing_prefix: '00'
305
+ :area_code: '594|694'
306
+ :mobile_format: '694\d{6}'
307
+ :local_number_format: '\d{6}'
308
+ :number_format: '[5|6]94\d{6}'
278
309
  -
279
310
  :country_code: '86'
280
311
  :national_dialing_prefix: '0'
@@ -300,6 +331,10 @@
300
331
  :iso_3166_code: CO
301
332
  :name: Colombia
302
333
  :international_dialing_prefix: '00'
334
+ :local_number_format: '[2-8]\d{6}'
335
+ :area_code: '3\d{2}|[1-8]'
336
+ :mobile_format: '3\d{2}\d{7}'
337
+ :number_format: '\d{1,3}[2-8]\d{6}'
303
338
  -
304
339
  :country_code: '58'
305
340
  :national_dialing_prefix: '0'
@@ -450,6 +485,10 @@
450
485
  :char_2_code: None
451
486
  :iso_3166_code: IQ
452
487
  :name: Iraq
488
+ :area_code: '1|\d{2}'
489
+ :local_number_format: '\d{6,8}'
490
+ :mobile_format: '7\d{9}'
491
+ :number_format: '\d{8,10}'
453
492
  :international_dialing_prefix: '00'
454
493
  -
455
494
  :country_code: '370'
@@ -493,6 +532,10 @@
493
532
  :char_2_code: None
494
533
  :iso_3166_code: KW
495
534
  :name: Kuwait
535
+ :area_code: '2|5|6|9'
536
+ :mobile_format: '(5|6|9)\d{7}'
537
+ :local_number_format: '\d{7}'
538
+ :number_format: '[2|5|6|9]\d{7}'
496
539
  :international_dialing_prefix: '00'
497
540
  -
498
541
  :country_code: '371'
@@ -613,6 +656,10 @@
613
656
  :iso_3166_code: TR
614
657
  :name: Turkey
615
658
  :international_dialing_prefix: '00'
659
+ :number_format: '\d{10}'
660
+ :area_code: '\d{3}'
661
+ :local_number_format: '\d{7}'
662
+ :mobile_format: '(530|531|532|533|534|535|536|537|538|539|540|541|542|543|544|545|546|547|548|549|500|501|502|503|504|505|506|507|508|509|550|551|552|553|554|555|556|557|558|559)\d{7}'
616
663
  -
617
664
  :country_code: '373'
618
665
  :national_dialing_prefix: '0'
@@ -677,9 +724,9 @@
677
724
  :iso_3166_code: ES
678
725
  :name: Spain
679
726
  :international_dialing_prefix: '00'
680
- :area_code: '[67]|9[134]|9[2567]\d'
727
+ :area_code: '(?:[89]0|9[1-68])7|(?:88|80|[89]?7|[89]5|9[1-48])6|(?:9?7|9[0-468])5|(?:9?7|[89]2|9[13568])4|(?:80|[89]?7|[89]4|9[12568])3|(?:[89]?7|9[013-68])2|(?:88|[89]?7|9[02-68])1|(?:9[24-68]|7)0|(?:9?7|9[04-6])9|(?:9?7|9[013]|[89][24-6])8|[89]?77|9(?:88|66|55|44|33|11)|[89](?:22|00)|[56]'
681
728
  :local_number_format: '\d{6,8}'
682
- :mobile_format: '[67]\d{8}'
729
+ :mobile_format: '[67][1-9]\d{7}'
683
730
  :number_format: '\d{9}'
684
731
  -
685
732
  :country_code: '232'
@@ -772,6 +819,10 @@
772
819
  :iso_3166_code: KH
773
820
  :name: Cambodia
774
821
  :international_dialing_prefix: '00'
822
+ :local_number_format: '\d{6,7}'
823
+ :area_code: '\d{2}'
824
+ :mobile_format: '(11|77|88|99|[17-9]0|[19]2|[189]3|[18]5|[17]6|[169]7|[1679]8|[6-8]9|8[14])\d{6,7}'
825
+ :number_format: '\d{8,9}'
775
826
  -
776
827
  :country_code: '261'
777
828
  :national_dialing_prefix: None
@@ -987,7 +1038,11 @@
987
1038
  :char_2_code: '0'
988
1039
  :iso_3166_code: TH
989
1040
  :name: Thailand
990
- :international_dialing_prefix: '00'
1041
+ :international_dialing_prefix: '001'
1042
+ :area_code: '(2|[3-9]\d)'
1043
+ :local_number_format: '\d{6,7}'
1044
+ :number_format: '\d{8}'
1045
+ :mobile_format: '([6,8,9][0-9])\d{6}'
991
1046
  -
992
1047
  :country_code: '886'
993
1048
  :national_dialing_prefix: None
@@ -995,6 +1050,10 @@
995
1050
  :iso_3166_code: TW
996
1051
  :name: Taiwan, Province Of China
997
1052
  :international_dialing_prefix: '002'
1053
+ :mobile_format: '9\d{8}'
1054
+ :area_code: '826|836|89|82|37|49|9|6|5|7|4|8|3|2'
1055
+ :number_format: '\d{8,9}'
1056
+ :local_number_format: '\d{5,8}'
998
1057
  -
999
1058
  :country_code: '378'
1000
1059
  :national_dialing_prefix: None
@@ -1247,12 +1306,22 @@
1247
1306
  :mobile_format: 6\d1\d{6}
1248
1307
  :number_format: \d{5,11}
1249
1308
  -
1250
- :country_code: '269'
1309
+ :country_code: '262'
1251
1310
  :national_dialing_prefix: None
1252
1311
  :char_2_code: None
1253
1312
  :iso_3166_code: YT
1254
1313
  :name: Mayotte
1255
1314
  :international_dialing_prefix: '00'
1315
+ -
1316
+ :country_code: '269'
1317
+ :national_dialing_prefix: None
1318
+ :char_2_code: None
1319
+ :iso_3166_code: KM
1320
+ :name: Comoros
1321
+ :international_dialing_prefix: '00'
1322
+ :area_code: '767|7{3}|77[45]|(?:76|77)[0-389]'
1323
+ :local_number_format: '\d{4}'
1324
+ :number_format: '\d{7}'
1256
1325
  -
1257
1326
  :country_code: '381'
1258
1327
  :national_dialing_prefix: '0'
@@ -1261,7 +1330,7 @@
1261
1330
  :name: Serbia
1262
1331
  :international_dialing_prefix: '00'
1263
1332
  :area_code: '[1-9]\d'
1264
- :local_number_format: \d{7}
1333
+ :local_number_format: \d{6,7}
1265
1334
  :mobile_format: 6\d{7,8}
1266
1335
  :number_format: '[1-57-9]\d{6,8}|6\d{7,8}'
1267
1336
  -
@@ -1307,6 +1376,10 @@
1307
1376
  :iso_3166_code: MA
1308
1377
  :name: Morocco
1309
1378
  :international_dialing_prefix: '00'
1379
+ :number_format: '\d{9}'
1380
+ :area_code: '53890|53880|52990|52980|5373|5224|5225|5226|5227|5228|5229|5232|5233|5234|5235|5237|5242|5243|5244|5246|5247|5248|5282|5283|5285|5286|5287|5288|5289|5290|5222|8920|5352|5353|5354|5355|5356|5357|5358|5359|5362|5363|5365|5366|5367|5368|5372|5223|5374|5375|5376|5377|5378|5379|5380|8921|8922|5394|5399|5398|5397|5396|5395|5393|644|610|611|612|613|614|615|616|617|618|619|636|637|640|641|642|521|645|646|647|649|648|650|651|652|653|534|533|532|531|530|654|655|656|657|658|659|660|661|662|663|527|526|525|664|665|666|667|668|669|670|671|672|673|674|675|676|677|678|679|520|80|89'
1381
+ :local_number_format: '\d{4,7}'
1382
+ :mobile_format: '6\d{8}'
1310
1383
  -
1311
1384
  :country_code: '382'
1312
1385
  :national_dialing_prefix: '0'
@@ -1342,6 +1415,10 @@
1342
1415
  :iso_3166_code: IS
1343
1416
  :name: Iceland
1344
1417
  :international_dialing_prefix: '00'
1418
+ :number_format: '\d{7}'
1419
+ :local_number_format: '\d{4}'
1420
+ :area_code: '\d{3}'
1421
+ :mobile_format: '[6-8]\d{6}'
1345
1422
  -
1346
1423
  :country_code: '43'
1347
1424
  :national_dialing_prefix: '0'
@@ -1413,11 +1490,15 @@
1413
1490
  :international_dialing_prefix: '00'
1414
1491
  -
1415
1492
  :country_code: '356'
1416
- :national_dialing_prefix: '21'
1417
- :char_2_code: '21'
1493
+ :national_dialing_prefix: None
1494
+ :char_2_code: None
1418
1495
  :iso_3166_code: MT
1419
1496
  :name: Malta
1420
1497
  :international_dialing_prefix: '00'
1498
+ :area_code: '2\d|[79]\d{1}'
1499
+ :number_format: \d{8}
1500
+ :local_number_format: \d{6}
1501
+ :mobile_format: '[78]\d{7}'
1421
1502
  -
1422
1503
  :country_code: '357'
1423
1504
  :national_dialing_prefix: None
@@ -1471,8 +1552,8 @@
1471
1552
  :international_dialing_prefix: '00'
1472
1553
  :area_code: 1|[2-9]\d
1473
1554
  :local_number_format: \d{6,7}
1474
- :mobile_format: 9\d{8}
1475
- :number_format: '[1-8]\d{7,8}|9\d{8}'
1555
+ :mobile_format: 9\d{7,8}
1556
+ :number_format: '[1-8]\d{7,8}|9\d{7,8}'
1476
1557
  -
1477
1558
  :country_code: '243'
1478
1559
  :national_dialing_prefix: None
@@ -1487,6 +1568,10 @@
1487
1568
  :iso_3166_code: TN
1488
1569
  :name: Tunisia
1489
1570
  :international_dialing_prefix: '00'
1571
+ :area_code: '\d{2}'
1572
+ :local_number_format: '\d{6}'
1573
+ :mobile_format: '(2|4|5|9)\d{7}'
1574
+ :number_format: '\d{8}'
1490
1575
  -
1491
1576
  :country_code: '386'
1492
1577
  :national_dialing_prefix: '0'
@@ -1552,6 +1637,10 @@
1552
1637
  :iso_3166_code: PL
1553
1638
  :name: Poland
1554
1639
  :international_dialing_prefix: '00'
1640
+ :mobile_format: '(50|51|53|57|60|66|69|72|73|78|79|88)\d{7}'
1641
+ :area_code: '50|51|53|57|60|66|69|72|73|78|79|88|12|13|14|15|16|17|18|22|23|24|25|29|32|33|34|41|42|43|44|46|48|52|54|55|56|58|59|61|62|63|65|67|68|71|74|75|76|77|81|82|83|84|85|86|87|89|91|94|95'
1642
+ :number_format: '\d{9}'
1643
+ :local_number_format: '\d{7}'
1555
1644
  -
1556
1645
  :country_code: '218'
1557
1646
  :national_dialing_prefix: '0'
@@ -1652,6 +1741,17 @@
1652
1741
  :iso_3166_code: PE
1653
1742
  :name: Peru
1654
1743
  :international_dialing_prefix: '00'
1744
+ -
1745
+ :country_code: '52'
1746
+ :national_dialing_prefix: '1'
1747
+ :char_2_code: '1'
1748
+ :iso_3166_code: MX
1749
+ :name: Mexico
1750
+ :international_dialing_prefix: '00'
1751
+ :area_code: '1?(55|81|33|656|614|999|222|442|664|661|646|686|667|722|998|871|744|444|833|961|962|687)'
1752
+ :local_number_format: '\d{7,8}'
1753
+ :mobile_format: '1(55|81|33|656|614|999|222|442|664|661|646|686|667|722|998|871|744|444|833|961|962|687)\d{7,8}'
1754
+ :number_format: '\d{10,11}'
1655
1755
  -
1656
1756
  :country_code: '220'
1657
1757
  :national_dialing_prefix: None
@@ -1683,6 +1783,10 @@
1683
1783
  :char_2_code: None
1684
1784
  :iso_3166_code: SN
1685
1785
  :name: Senegal
1786
+ :area_code: '7|33'
1787
+ :local_number_format: '\d{7,8}'
1788
+ :mobile_format: '7\d{8}'
1789
+ :number_format: '\d{9}'
1686
1790
  :international_dialing_prefix: '00'
1687
1791
  -
1688
1792
  :country_code: '674'
@@ -1733,6 +1837,10 @@
1733
1837
  :iso_3166_code: NI
1734
1838
  :name: Nicaragua
1735
1839
  :international_dialing_prefix: '00'
1840
+ :area_code: \d
1841
+ :mobile_format: 8\d{7}
1842
+ :number_format: '\d{8}'
1843
+ :local_number_format: \d{7}
1736
1844
  -
1737
1845
  :country_code: '222'
1738
1846
  :national_dialing_prefix: '0'
@@ -1747,13 +1855,6 @@
1747
1855
  :iso_3166_code: CU
1748
1856
  :name: Cuba
1749
1857
  :international_dialing_prefix: '119'
1750
- -
1751
- :country_code: '81'
1752
- :national_dialing_prefix: '0'
1753
- :char_2_code: '0'
1754
- :iso_3166_code: JP
1755
- :name: Japan
1756
- :international_dialing_prefix: '010'
1757
1858
  -
1758
1859
  :country_code: '211'
1759
1860
  :national_dialing_prefix: '0'
@@ -1,3 +1,3 @@
1
1
  module Phonie
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Burkina Faso
4
+ class BFTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+22620491705', '226', '20', '491705', 'Burkina Faso', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+22678101705', '226', '78', '101705', 'Burkina Faso', true)
11
+ end
12
+ end
13
+
14
+
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Colombia
4
+ class COTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+5768724057', '57', '6', '8724057', 'Colombia', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+573004885879', '57', '300', '4885879', 'Colombia', true)
11
+ parse_test('+573132335285', '57', '313', '2335285', 'Colombia', true)
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Spain
4
+ class ESTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+34985204499', '34', '985', '204499', 'Spain', false)
7
+ parse_test('+34902107303', '34', '902', '107303', 'Spain', false)
8
+ parse_test('+34985892398', '34', '985', '892398', 'Spain', false)
9
+ end
10
+
11
+ def test_mobile
12
+ parse_test('+34644161452', '34', '6', '44161452', 'Spain', true)
13
+ parse_test('+34635399976', '34', '6', '35399976', 'Spain', true)
14
+ end
15
+ end
16
+
@@ -0,0 +1,15 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## French Guiana
4
+ class GFTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+594594123456', '594', '594', '123456', 'French Guiana', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+594694123456', '594', '694', '123456', 'French Guiana', true)
11
+ end
12
+ end
13
+
14
+
15
+
@@ -9,6 +9,7 @@ class HRTest < Phonie::TestCase
9
9
 
10
10
  def test_mobile
11
11
  parse_test('+385915125486', '385', '91', '5125486', 'Croatia', true)
12
+ parse_test('+38598800916', '385', '98', '800916', 'Croatia', true)
12
13
  end
13
14
 
14
15
  def test_long_without_special_characters
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Haiti
4
+ class HTTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+509 22 45 3300', '509', '22', '453300', 'Haiti', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+509 36 63 1234', '509', '36', '631234', 'Haiti', true)
11
+ end
12
+ end
13
+
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Iraq
4
+ class IQTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+9642301948190', '964', '23', '01948190', 'Iraq', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+9647901948190', '964', '79', '01948190', 'Iraq', true)
11
+ end
12
+ end
13
+
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Iceland
4
+ class ISTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+354421 1234', '354', '421', '1234', 'Iceland', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+354621 1234', '354', '621', '1234', 'Iceland', true)
11
+ end
12
+ end
13
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Japan
4
+ class JPTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+81473558326', '81', '47', '3558326', 'Japan', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+818052806993', '81', '80', '52806993', 'Japan', true)
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Cambodia
4
+ class KHTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+85535849285', '855', '35', '849285', 'Cambodia', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+85588325969', '855', '88', '325969', 'Cambodia', true)
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Comoros
4
+ class KMTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+2697679833', '269', '767', '9833', 'Comoros')
7
+ end
8
+ end
9
+
@@ -1,6 +1,6 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
2
 
3
- ## Korea, Republic of
3
+ ## Korea, Republic of
4
4
  class KRTest < Phonie::TestCase
5
5
  def test_local
6
6
  parse_test('+8223123456', '82', '2', '3123456', 'Korea, Republic of', false)
@@ -12,5 +12,7 @@ class KRTest < Phonie::TestCase
12
12
  def test_mobile
13
13
  parse_test('+82103123456', '82', '10', '3123456', 'Korea, Republic of', true)
14
14
  parse_test('+82193123456', '82', '19', '3123456', 'Korea, Republic of', true)
15
+ parse_test('+821085421653', '82', '10', '85421653', 'Korea, Republic of', true)
16
+ parse_test('+821195188293', '82', '11', '95188293', 'Korea, Republic of', true)
15
17
  end
16
- end
18
+ end
@@ -0,0 +1,15 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Kuwait
4
+ class KWTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+96521234567', '965', '2', '1234567', 'Kuwait', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+96551234567', '965', '5', '1234567', 'Kuwait', true)
11
+ parse_test('+96561234567', '965', '6', '1234567', 'Kuwait', true)
12
+ parse_test('+96591234567', '965', '9', '1234567', 'Kuwait', true)
13
+ end
14
+ end
15
+
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Morocco
4
+ class MOTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+212 520123456', '212', '520', '123456', 'Morocco', false)
7
+ parse_test('+212 538901234', '212', '53890', '1234', 'Morocco', false)
8
+ end
9
+
10
+ def test_mobile
11
+ parse_test('+212 610123456', '212', '610', '123456', 'Morocco', true)
12
+ parse_test('+212 668680069', '212', '668', '680069', 'Morocco', true)
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Malta
4
+ class MTTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+35622060250', '356', '22', '060250', 'Malta', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+35677060250', '356', '77', '060250', 'Malta', true)
11
+ end
12
+
13
+ end
14
+
@@ -0,0 +1,15 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Mexico
4
+ class MXTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+52 33 36159895', '52', '33', '36159895', 'Mexico', false)
7
+ parse_test('+52 686 3615989', '52', '686', '3615989', 'Mexico', false)
8
+ end
9
+
10
+ def test_mobile
11
+ # Mobile phones have extra 1 in front
12
+ parse_test('+52 1 55 12345678', '52', '155', '12345678', 'Mexico', true)
13
+ parse_test('+52 1 444 1234567', '52', '1444', '1234567', 'Mexico', true)
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Nicaragua
4
+ class NITest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+50529800400', '505', '2', '9800400', 'Nicaragua', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+50589800400', '505', '8', '9800400', 'Nicaragua', true)
11
+ end
12
+ end
13
+
14
+
15
+
16
+
@@ -0,0 +1,17 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Poland
4
+ class PLTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+48 225109999', '48', '22', '5109999', 'Poland', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+48 600 887 057', '48', '60', '0887057', 'Poland', true)
11
+ parse_test('+48 660 923 990', '48', '66', '0923990', 'Poland', true)
12
+ parse_test('+48 884 001 872', '48', '88', '4001872', 'Poland', true)
13
+ parse_test('+48 536 809 829', '48', '53', '6809829', 'Poland', true)
14
+ end
15
+ end
16
+
17
+
@@ -11,5 +11,6 @@ class RSTest < Phonie::TestCase
11
11
  def test_mobile
12
12
  # mts
13
13
  parse_test('+381 648542987', '381', '64', '8542987', "Serbia", true)
14
+ parse_test('+381 63399599', '381', '63', '399599', "Serbia", true)
14
15
  end
15
16
  end
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Slovakia
4
+ class SKTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+421244637253', '421', '2', '44637253', 'Slovakia', false)
7
+ parse_test('+421244637251', '421', '2', '44637251', 'Slovakia', false)
8
+ end
9
+
10
+ def test_mobile
11
+ parse_test('+421944637251', '421', '9', '44637251', 'Slovakia', true)
12
+ end
13
+ end
14
+
@@ -0,0 +1,14 @@
1
+
2
+
3
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
4
+
5
+ ## Senegal
6
+ class SNTest < Phonie::TestCase
7
+ def test_local
8
+ parse_test('+221336416455', '221', '33', '6416455', 'Senegal', false)
9
+ end
10
+
11
+ def test_mobile
12
+ parse_test('+221786416455', '221', '7', '86416455', 'Senegal', true)
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Thailand
4
+ class THTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+6622134567', '66', '2', '2134567', 'Thailand', false)
7
+ parse_test('+6632734256', '66', '32', '734256', 'Thailand', false)
8
+ end
9
+
10
+ def test_mobile
11
+ parse_test('+6687342563', '66', '87', '342563', 'Thailand', true)
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Tunisia
4
+ class TNTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+21672534819', '216', '72', '534819', 'Tunisia', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+21621826805', '216', '21', '826805', 'Tunisia', true)
11
+ end
12
+ end
13
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Turkey
4
+ class TRTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+902122927759', '90', '212', '2927759', 'Turkey', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+905333364565', '90', '533', '3364565', 'Turkey', true)
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Taiwan
4
+ class TWTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+886423194678', '886', '4', '23194678', 'Taiwan, Province Of China', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+886952475345', '886', '9', '52475345', 'Taiwan, Province Of China', true)
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
2
+
3
+ ## Viet Nam
4
+ class VNTest < Phonie::TestCase
5
+ def test_local
6
+ parse_test('+84701208230', '84', '70', '1208230', 'Viet Nam', false)
7
+ end
8
+
9
+ def test_mobile
10
+ parse_test('+84909208230', '84', '90', '9208230', 'Viet Nam', true)
11
+ end
12
+ end
13
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonie
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-07-23 00:00:00.000000000 Z
16
+ date: 2013-07-31 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activemodel
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - .gitignore
78
+ - .travis.yml
78
79
  - Gemfile
79
80
  - LICENSE
80
81
  - Rakefile
@@ -101,6 +102,7 @@ files:
101
102
  - test/countries/ba_test.rb
102
103
  - test/countries/bd_test.rb
103
104
  - test/countries/be_test.rb
105
+ - test/countries/bf_test.rb
104
106
  - test/countries/bg_test.rb
105
107
  - test/countries/bo_test.rb
106
108
  - test/countries/br_test.rb
@@ -112,6 +114,7 @@ files:
112
114
  - test/countries/ch_test.rb
113
115
  - test/countries/cl_test.rb
114
116
  - test/countries/cn_test.rb
117
+ - test/countries/co_test.rb
115
118
  - test/countries/cr_test.rb
116
119
  - test/countries/cy_test.rb
117
120
  - test/countries/cz_test.rb
@@ -121,37 +124,51 @@ files:
121
124
  - test/countries/ec_test.rb
122
125
  - test/countries/ee_test.rb
123
126
  - test/countries/eg_test.rb
127
+ - test/countries/es_test.rb
124
128
  - test/countries/et_test.rb
125
129
  - test/countries/fi_test.rb
126
130
  - test/countries/fr_test.rb
127
131
  - test/countries/gb_test.rb
128
132
  - test/countries/ge_test.rb
133
+ - test/countries/gf_test.rb
129
134
  - test/countries/gh_test.rb
130
135
  - test/countries/gr_test.rb
131
136
  - test/countries/gt_test.rb
132
137
  - test/countries/gu_test.rb
133
138
  - test/countries/gy_test.rb
134
139
  - test/countries/hr_test.rb
140
+ - test/countries/ht_test.rb
135
141
  - test/countries/hu_test.rb
136
142
  - test/countries/ie_test.rb
137
143
  - test/countries/il_test.rb
138
144
  - test/countries/in_test.rb
145
+ - test/countries/iq_test.rb
139
146
  - test/countries/ir_test.rb
147
+ - test/countries/is_test.rb
140
148
  - test/countries/it_test.rb
149
+ - test/countries/jp_test.rb
141
150
  - test/countries/ke_test.rb
151
+ - test/countries/kh_text.rb
152
+ - test/countries/km_test.rb
142
153
  - test/countries/kr_test.rb
154
+ - test/countries/kw_test.rb
143
155
  - test/countries/lk_test.rb
144
156
  - test/countries/lt_test.rb
145
157
  - test/countries/lu_test.rb
146
158
  - test/countries/lv_test.rb
159
+ - test/countries/ma_test.rb
160
+ - test/countries/mt_test.rb
147
161
  - test/countries/mu_test.rb
162
+ - test/countries/mx_test.rb
148
163
  - test/countries/ng_test.rb
164
+ - test/countries/ni_test.rb
149
165
  - test/countries/nl_test.rb
150
166
  - test/countries/no_test.rb
151
167
  - test/countries/np_test.rb
152
168
  - test/countries/nz_test.rb
153
169
  - test/countries/ph_test.rb
154
170
  - test/countries/pk_test.rb
171
+ - test/countries/pl_test.rb
155
172
  - test/countries/pr_test.rb
156
173
  - test/countries/pt_test.rb
157
174
  - test/countries/qa_test.rb
@@ -161,11 +178,18 @@ files:
161
178
  - test/countries/sa_test.rb
162
179
  - test/countries/se_test.rb
163
180
  - test/countries/si_test.rb
181
+ - test/countries/sk_test.rb
182
+ - test/countries/sn_test.rb
164
183
  - test/countries/sv_test.rb
184
+ - test/countries/th_test.rb
185
+ - test/countries/tn_test.rb
165
186
  - test/countries/to_test.rb
187
+ - test/countries/tr_test.rb
188
+ - test/countries/tw_test.rb
166
189
  - test/countries/ua_test.rb
167
190
  - test/countries/us_test.rb
168
191
  - test/countries/uy_test.rb
192
+ - test/countries/vn_test.rb
169
193
  - test/countries/za_test.rb
170
194
  - test/countries/zw_test.rb
171
195
  - test/country_test.rb
@@ -190,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
214
  version: '0'
191
215
  segments:
192
216
  - 0
193
- hash: -2285805841961836759
217
+ hash: 2741495440992625171
194
218
  required_rubygems_version: !ruby/object:Gem::Requirement
195
219
  none: false
196
220
  requirements:
@@ -199,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
223
  version: '0'
200
224
  segments:
201
225
  - 0
202
- hash: -2285805841961836759
226
+ hash: 2741495440992625171
203
227
  requirements: []
204
228
  rubyforge_project:
205
229
  rubygems_version: 1.8.23
@@ -218,6 +242,7 @@ test_files:
218
242
  - test/countries/ba_test.rb
219
243
  - test/countries/bd_test.rb
220
244
  - test/countries/be_test.rb
245
+ - test/countries/bf_test.rb
221
246
  - test/countries/bg_test.rb
222
247
  - test/countries/bo_test.rb
223
248
  - test/countries/br_test.rb
@@ -229,6 +254,7 @@ test_files:
229
254
  - test/countries/ch_test.rb
230
255
  - test/countries/cl_test.rb
231
256
  - test/countries/cn_test.rb
257
+ - test/countries/co_test.rb
232
258
  - test/countries/cr_test.rb
233
259
  - test/countries/cy_test.rb
234
260
  - test/countries/cz_test.rb
@@ -238,37 +264,51 @@ test_files:
238
264
  - test/countries/ec_test.rb
239
265
  - test/countries/ee_test.rb
240
266
  - test/countries/eg_test.rb
267
+ - test/countries/es_test.rb
241
268
  - test/countries/et_test.rb
242
269
  - test/countries/fi_test.rb
243
270
  - test/countries/fr_test.rb
244
271
  - test/countries/gb_test.rb
245
272
  - test/countries/ge_test.rb
273
+ - test/countries/gf_test.rb
246
274
  - test/countries/gh_test.rb
247
275
  - test/countries/gr_test.rb
248
276
  - test/countries/gt_test.rb
249
277
  - test/countries/gu_test.rb
250
278
  - test/countries/gy_test.rb
251
279
  - test/countries/hr_test.rb
280
+ - test/countries/ht_test.rb
252
281
  - test/countries/hu_test.rb
253
282
  - test/countries/ie_test.rb
254
283
  - test/countries/il_test.rb
255
284
  - test/countries/in_test.rb
285
+ - test/countries/iq_test.rb
256
286
  - test/countries/ir_test.rb
287
+ - test/countries/is_test.rb
257
288
  - test/countries/it_test.rb
289
+ - test/countries/jp_test.rb
258
290
  - test/countries/ke_test.rb
291
+ - test/countries/kh_text.rb
292
+ - test/countries/km_test.rb
259
293
  - test/countries/kr_test.rb
294
+ - test/countries/kw_test.rb
260
295
  - test/countries/lk_test.rb
261
296
  - test/countries/lt_test.rb
262
297
  - test/countries/lu_test.rb
263
298
  - test/countries/lv_test.rb
299
+ - test/countries/ma_test.rb
300
+ - test/countries/mt_test.rb
264
301
  - test/countries/mu_test.rb
302
+ - test/countries/mx_test.rb
265
303
  - test/countries/ng_test.rb
304
+ - test/countries/ni_test.rb
266
305
  - test/countries/nl_test.rb
267
306
  - test/countries/no_test.rb
268
307
  - test/countries/np_test.rb
269
308
  - test/countries/nz_test.rb
270
309
  - test/countries/ph_test.rb
271
310
  - test/countries/pk_test.rb
311
+ - test/countries/pl_test.rb
272
312
  - test/countries/pr_test.rb
273
313
  - test/countries/pt_test.rb
274
314
  - test/countries/qa_test.rb
@@ -278,11 +318,18 @@ test_files:
278
318
  - test/countries/sa_test.rb
279
319
  - test/countries/se_test.rb
280
320
  - test/countries/si_test.rb
321
+ - test/countries/sk_test.rb
322
+ - test/countries/sn_test.rb
281
323
  - test/countries/sv_test.rb
324
+ - test/countries/th_test.rb
325
+ - test/countries/tn_test.rb
282
326
  - test/countries/to_test.rb
327
+ - test/countries/tr_test.rb
328
+ - test/countries/tw_test.rb
283
329
  - test/countries/ua_test.rb
284
330
  - test/countries/us_test.rb
285
331
  - test/countries/uy_test.rb
332
+ - test/countries/vn_test.rb
286
333
  - test/countries/za_test.rb
287
334
  - test/countries/zw_test.rb
288
335
  - test/country_test.rb