phony 2.20.14 → 2.20.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phony/config.rb +25 -26
- data/lib/phony/countries/argentina.rb +311 -314
- data/lib/phony/countries/austria.rb +71 -72
- data/lib/phony/countries/bangladesh.rb +27 -28
- data/lib/phony/countries/belarus.rb +110 -111
- data/lib/phony/countries/brazil.rb +92 -92
- data/lib/phony/countries/cambodia.rb +9 -9
- data/lib/phony/countries/china.rb +22 -21
- data/lib/phony/countries/croatia.rb +6 -5
- data/lib/phony/countries/georgia.rb +84 -84
- data/lib/phony/countries/germany.rb +4067 -4068
- data/lib/phony/countries/guinea.rb +8 -8
- data/lib/phony/countries/india.rb +31 -34
- data/lib/phony/countries/indonesia.rb +57 -46
- data/lib/phony/countries/ireland.rb +4 -5
- data/lib/phony/countries/italy.rb +54 -53
- data/lib/phony/countries/japan.rb +456 -456
- data/lib/phony/countries/kyrgyzstan.rb +109 -109
- data/lib/phony/countries/latvia.rb +34 -34
- data/lib/phony/countries/libya.rb +106 -106
- data/lib/phony/countries/malaysia.rb +12 -12
- data/lib/phony/countries/moldova.rb +42 -42
- data/lib/phony/countries/montenegro.rb +24 -20
- data/lib/phony/countries/myanmar.rb +39 -39
- data/lib/phony/countries/namibia.rb +35 -29
- data/lib/phony/countries/nepal.rb +60 -62
- data/lib/phony/countries/netherlands.rb +13 -13
- data/lib/phony/countries/pakistan.rb +134 -110
- data/lib/phony/countries/paraguay.rb +135 -135
- data/lib/phony/countries/russia_kazakhstan_abkhasia_south_ossetia.rb +125 -128
- data/lib/phony/countries/saudi_arabia.rb +5 -5
- data/lib/phony/countries/serbia.rb +47 -39
- data/lib/phony/countries/somalia.rb +18 -18
- data/lib/phony/countries/south_korea.rb +16 -13
- data/lib/phony/countries/sweden.rb +28 -28
- data/lib/phony/countries/taiwan.rb +20 -19
- data/lib/phony/countries/tajikistan.rb +70 -70
- data/lib/phony/countries/turkmenistan.rb +65 -65
- data/lib/phony/countries/ukraine.rb +607 -607
- data/lib/phony/countries/united_kingdom.rb +66 -66
- data/lib/phony/countries/uruguay.rb +40 -41
- data/lib/phony/countries/vietnam.rb +18 -17
- data/lib/phony/countries/zimbabwe.rb +31 -31
- data/lib/phony/countries.rb +440 -443
- data/lib/phony/country.rb +42 -44
- data/lib/phony/country_codes.rb +61 -60
- data/lib/phony/dsl.rb +23 -26
- data/lib/phony/local_splitters/fixed.rb +20 -29
- data/lib/phony/local_splitters/regex.rb +28 -31
- data/lib/phony/national_code.rb +7 -10
- data/lib/phony/national_splitters/default.rb +9 -11
- data/lib/phony/national_splitters/dsl.rb +8 -18
- data/lib/phony/national_splitters/fixed.rb +11 -14
- data/lib/phony/national_splitters/none.rb +7 -11
- data/lib/phony/national_splitters/regex.rb +13 -17
- data/lib/phony/national_splitters/variable.rb +36 -38
- data/lib/phony/trunk_code.rb +16 -18
- data/lib/phony/vanity.rb +12 -13
- data/lib/phony.rb +84 -84
- metadata +5 -39
- data/spec/functional/config_spec.rb +0 -44
- data/spec/functional/plausibility_spec.rb +0 -689
- data/spec/lib/phony/countries_spec.rb +0 -1460
- data/spec/lib/phony/country_codes_spec.rb +0 -227
- data/spec/lib/phony/country_spec.rb +0 -104
- data/spec/lib/phony/dsl_spec.rb +0 -28
- data/spec/lib/phony/local_splitters/fixed_spec.rb +0 -56
- data/spec/lib/phony/local_splitters/regex_spec.rb +0 -94
- data/spec/lib/phony/national_code_spec.rb +0 -61
- data/spec/lib/phony/national_splitters/default_spec.rb +0 -34
- data/spec/lib/phony/national_splitters/fixed_spec.rb +0 -45
- data/spec/lib/phony/national_splitters/none_spec.rb +0 -28
- data/spec/lib/phony/national_splitters/regex_spec.rb +0 -23
- data/spec/lib/phony/national_splitters/variable_spec.rb +0 -35
- data/spec/lib/phony/trunk_code_spec.rb +0 -85
- data/spec/lib/phony/vanity_spec.rb +0 -30
- data/spec/lib/phony_spec.rb +0 -70
@@ -7,315 +7,314 @@
|
|
7
7
|
# https://en.wikipedia.org/wiki/Telephone_numbers_in_Argentina
|
8
8
|
# Area codes collected from https://www.enacom.gob.ar/indicativos-interurbanos_p366 (06/27/19)
|
9
9
|
|
10
|
-
|
11
10
|
# Landline
|
12
11
|
area_codes_2digits = [
|
13
|
-
|
12
|
+
'11'
|
14
13
|
]
|
15
14
|
|
16
|
-
area_codes_3digits = [
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
15
|
+
area_codes_3digits = %w[
|
16
|
+
220
|
17
|
+
221
|
18
|
+
223
|
19
|
+
230
|
20
|
+
236
|
21
|
+
237
|
22
|
+
249
|
23
|
+
260
|
24
|
+
261
|
25
|
+
263
|
26
|
+
264
|
27
|
+
266
|
28
|
+
280
|
29
|
+
291
|
30
|
+
294
|
31
|
+
297
|
32
|
+
298
|
33
|
+
299
|
34
|
+
336
|
35
|
+
341
|
36
|
+
342
|
37
|
+
343
|
38
|
+
345
|
39
|
+
348
|
40
|
+
351
|
41
|
+
353
|
42
|
+
358
|
43
|
+
362
|
44
|
+
364
|
45
|
+
370
|
46
|
+
376
|
47
|
+
379
|
48
|
+
380
|
49
|
+
381
|
50
|
+
383
|
51
|
+
385
|
52
|
+
387
|
53
|
+
388
|
55
54
|
]
|
56
55
|
|
57
|
-
area_codes_4digits = [
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
56
|
+
area_codes_4digits = %w[
|
57
|
+
2202
|
58
|
+
2221
|
59
|
+
2223
|
60
|
+
2224
|
61
|
+
2225
|
62
|
+
2226
|
63
|
+
2227
|
64
|
+
2229
|
65
|
+
2241
|
66
|
+
2242
|
67
|
+
2243
|
68
|
+
2244
|
69
|
+
2245
|
70
|
+
2246
|
71
|
+
2252
|
72
|
+
2254
|
73
|
+
2255
|
74
|
+
2257
|
75
|
+
2261
|
76
|
+
2262
|
77
|
+
2264
|
78
|
+
2265
|
79
|
+
2266
|
80
|
+
2267
|
81
|
+
2268
|
82
|
+
2271
|
83
|
+
2272
|
84
|
+
2273
|
85
|
+
2274
|
86
|
+
2281
|
87
|
+
2283
|
88
|
+
2284
|
89
|
+
2285
|
90
|
+
2286
|
91
|
+
2291
|
92
|
+
2292
|
93
|
+
2296
|
94
|
+
2297
|
95
|
+
2302
|
96
|
+
2314
|
97
|
+
2316
|
98
|
+
2317
|
99
|
+
2320
|
100
|
+
2323
|
101
|
+
2324
|
102
|
+
2325
|
103
|
+
2326
|
104
|
+
2331
|
105
|
+
2333
|
106
|
+
2334
|
107
|
+
2335
|
108
|
+
2336
|
109
|
+
2337
|
110
|
+
2338
|
111
|
+
2342
|
112
|
+
2343
|
113
|
+
2344
|
114
|
+
2345
|
115
|
+
2346
|
116
|
+
2352
|
117
|
+
2353
|
118
|
+
2354
|
119
|
+
2355
|
120
|
+
2356
|
121
|
+
2357
|
122
|
+
2358
|
123
|
+
2392
|
124
|
+
2393
|
125
|
+
2394
|
126
|
+
2395
|
127
|
+
2396
|
128
|
+
2473
|
129
|
+
2474
|
130
|
+
2475
|
131
|
+
2477
|
132
|
+
2478
|
133
|
+
2622
|
134
|
+
2624
|
135
|
+
2625
|
136
|
+
2626
|
137
|
+
2646
|
138
|
+
2647
|
139
|
+
2648
|
140
|
+
2651
|
141
|
+
2655
|
142
|
+
2656
|
143
|
+
2657
|
144
|
+
2658
|
145
|
+
2901
|
146
|
+
2902
|
147
|
+
2903
|
148
|
+
2920
|
149
|
+
2921
|
150
|
+
2922
|
151
|
+
2923
|
152
|
+
2924
|
153
|
+
2925
|
154
|
+
2926
|
155
|
+
2927
|
156
|
+
2928
|
157
|
+
2929
|
158
|
+
2931
|
159
|
+
2932
|
160
|
+
2933
|
161
|
+
2934
|
162
|
+
2935
|
163
|
+
2936
|
164
|
+
2940
|
165
|
+
2942
|
166
|
+
2945
|
167
|
+
2946
|
168
|
+
2948
|
169
|
+
2952
|
170
|
+
2953
|
171
|
+
2954
|
172
|
+
2962
|
173
|
+
2963
|
174
|
+
2964
|
175
|
+
2966
|
176
|
+
2972
|
177
|
+
2982
|
178
|
+
2983
|
179
|
+
3327
|
180
|
+
3329
|
181
|
+
3382
|
182
|
+
3385
|
183
|
+
3387
|
184
|
+
3388
|
185
|
+
3400
|
186
|
+
3401
|
187
|
+
3402
|
188
|
+
3404
|
189
|
+
3405
|
190
|
+
3406
|
191
|
+
3407
|
192
|
+
3408
|
193
|
+
3409
|
194
|
+
3435
|
195
|
+
3436
|
196
|
+
3437
|
197
|
+
3438
|
198
|
+
3442
|
199
|
+
3444
|
200
|
+
3445
|
201
|
+
3446
|
202
|
+
3447
|
203
|
+
3454
|
204
|
+
3455
|
205
|
+
3456
|
206
|
+
3458
|
207
|
+
3460
|
208
|
+
3462
|
209
|
+
3463
|
210
|
+
3464
|
211
|
+
3465
|
212
|
+
3466
|
213
|
+
3467
|
214
|
+
3468
|
215
|
+
3469
|
216
|
+
3471
|
217
|
+
3472
|
218
|
+
3476
|
219
|
+
3482
|
220
|
+
3483
|
221
|
+
3487
|
222
|
+
3489
|
223
|
+
3491
|
224
|
+
3492
|
225
|
+
3493
|
226
|
+
3496
|
227
|
+
3497
|
228
|
+
3498
|
229
|
+
3521
|
230
|
+
3522
|
231
|
+
3524
|
232
|
+
3525
|
233
|
+
3532
|
234
|
+
3533
|
235
|
+
3537
|
236
|
+
3541
|
237
|
+
3542
|
238
|
+
3543
|
239
|
+
3544
|
240
|
+
3546
|
241
|
+
3547
|
242
|
+
3548
|
243
|
+
3549
|
244
|
+
3562
|
245
|
+
3563
|
246
|
+
3564
|
247
|
+
3571
|
248
|
+
3572
|
249
|
+
3573
|
250
|
+
3574
|
251
|
+
3575
|
252
|
+
3576
|
253
|
+
3582
|
254
|
+
3583
|
255
|
+
3584
|
256
|
+
3585
|
257
|
+
3711
|
258
|
+
3715
|
259
|
+
3716
|
260
|
+
3718
|
261
|
+
3721
|
262
|
+
3725
|
263
|
+
3731
|
264
|
+
3734
|
265
|
+
3735
|
266
|
+
3741
|
267
|
+
3743
|
268
|
+
3751
|
269
|
+
3754
|
270
|
+
3755
|
271
|
+
3756
|
272
|
+
3757
|
273
|
+
3758
|
274
|
+
3772
|
275
|
+
3773
|
276
|
+
3774
|
277
|
+
3775
|
278
|
+
3777
|
279
|
+
3781
|
280
|
+
3782
|
281
|
+
3786
|
282
|
+
3821
|
283
|
+
3825
|
284
|
+
3826
|
285
|
+
3827
|
286
|
+
3832
|
287
|
+
3835
|
288
|
+
3837
|
289
|
+
3838
|
290
|
+
3841
|
291
|
+
3843
|
292
|
+
3844
|
293
|
+
3845
|
294
|
+
3846
|
295
|
+
3854
|
296
|
+
3855
|
297
|
+
3856
|
298
|
+
3857
|
299
|
+
3858
|
300
|
+
3861
|
301
|
+
3862
|
302
|
+
3863
|
303
|
+
3865
|
304
|
+
3867
|
305
|
+
3868
|
306
|
+
3869
|
307
|
+
3873
|
308
|
+
3876
|
309
|
+
3877
|
310
|
+
3878
|
311
|
+
3885
|
312
|
+
3886
|
313
|
+
3887
|
314
|
+
3888
|
315
|
+
3891
|
316
|
+
3892
|
317
|
+
3894
|
319
318
|
]
|
320
319
|
|
321
320
|
# Mobile
|
@@ -324,8 +323,6 @@ area_codes_4digits = [
|
|
324
323
|
# landline numbers are. The difference with landline numbers is that a prefix 15, never used for
|
325
324
|
# landlines, must be dialed.
|
326
325
|
|
327
|
-
|
328
|
-
|
329
326
|
# International: +54 + 9 + area code + subscriber number (without '15' prefix)
|
330
327
|
# Domestic: area code + 15 + subscriber number
|
331
328
|
# Mobile numbers in Argentina may be listed as 15-xxxxxxx. However, the leading '15'
|
@@ -340,16 +337,16 @@ special_numbers = [
|
|
340
337
|
'600', # premium-rate telephone numbers
|
341
338
|
'609', # premium, fixed-rate gaming numbers
|
342
339
|
'610', # dial-up Internet access numbers, usually cheaper than a local call, less frequently used as dial-up Internet access decreased
|
343
|
-
'605'
|
340
|
+
'605' # premium-rate telephone numbers for charity donations
|
344
341
|
]
|
345
342
|
|
346
343
|
Phony.define do
|
347
|
-
country '54', trunk('0')
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
344
|
+
country '54', trunk('0') |
|
345
|
+
one_of(area_codes_4digits) >> split(2, 4) | # landline
|
346
|
+
one_of(area_codes_3digits) >> split(3, 4) | # landline
|
347
|
+
one_of(area_codes_2digits) >> split(4, 4) | # landline
|
348
|
+
one_of(area_codes_2digits.map { |x| "9#{x}" }) >> split(4, 4) | # mobile
|
349
|
+
one_of(area_codes_3digits.map { |x| "9#{x}" }) >> split(3, 4) | # mobile
|
350
|
+
one_of(area_codes_4digits.map { |x| "9#{x}" }) >> split(2, 4) | # mobile
|
351
|
+
one_of(special_numbers) >> split(3, 4)
|
355
352
|
end
|