phony 2.20.14 → 2.20.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/phony/config.rb +25 -26
  3. data/lib/phony/countries/argentina.rb +311 -314
  4. data/lib/phony/countries/austria.rb +71 -72
  5. data/lib/phony/countries/bangladesh.rb +27 -28
  6. data/lib/phony/countries/belarus.rb +110 -111
  7. data/lib/phony/countries/brazil.rb +92 -92
  8. data/lib/phony/countries/cambodia.rb +9 -9
  9. data/lib/phony/countries/china.rb +22 -21
  10. data/lib/phony/countries/croatia.rb +6 -5
  11. data/lib/phony/countries/georgia.rb +84 -84
  12. data/lib/phony/countries/germany.rb +4067 -4068
  13. data/lib/phony/countries/guinea.rb +8 -8
  14. data/lib/phony/countries/india.rb +31 -34
  15. data/lib/phony/countries/indonesia.rb +57 -46
  16. data/lib/phony/countries/ireland.rb +4 -5
  17. data/lib/phony/countries/italy.rb +54 -53
  18. data/lib/phony/countries/japan.rb +456 -456
  19. data/lib/phony/countries/kyrgyzstan.rb +109 -109
  20. data/lib/phony/countries/latvia.rb +34 -34
  21. data/lib/phony/countries/libya.rb +106 -106
  22. data/lib/phony/countries/malaysia.rb +12 -12
  23. data/lib/phony/countries/moldova.rb +42 -42
  24. data/lib/phony/countries/montenegro.rb +24 -20
  25. data/lib/phony/countries/myanmar.rb +39 -39
  26. data/lib/phony/countries/namibia.rb +35 -29
  27. data/lib/phony/countries/nepal.rb +60 -62
  28. data/lib/phony/countries/netherlands.rb +13 -13
  29. data/lib/phony/countries/pakistan.rb +134 -110
  30. data/lib/phony/countries/paraguay.rb +135 -135
  31. data/lib/phony/countries/russia_kazakhstan_abkhasia_south_ossetia.rb +125 -128
  32. data/lib/phony/countries/saudi_arabia.rb +5 -5
  33. data/lib/phony/countries/serbia.rb +47 -39
  34. data/lib/phony/countries/somalia.rb +18 -18
  35. data/lib/phony/countries/south_korea.rb +16 -13
  36. data/lib/phony/countries/sweden.rb +28 -28
  37. data/lib/phony/countries/taiwan.rb +20 -19
  38. data/lib/phony/countries/tajikistan.rb +70 -70
  39. data/lib/phony/countries/turkmenistan.rb +65 -65
  40. data/lib/phony/countries/ukraine.rb +607 -607
  41. data/lib/phony/countries/united_kingdom.rb +66 -66
  42. data/lib/phony/countries/uruguay.rb +40 -41
  43. data/lib/phony/countries/vietnam.rb +18 -17
  44. data/lib/phony/countries/zimbabwe.rb +31 -31
  45. data/lib/phony/countries.rb +440 -443
  46. data/lib/phony/country.rb +42 -44
  47. data/lib/phony/country_codes.rb +61 -60
  48. data/lib/phony/dsl.rb +23 -26
  49. data/lib/phony/local_splitters/fixed.rb +20 -29
  50. data/lib/phony/local_splitters/regex.rb +28 -31
  51. data/lib/phony/national_code.rb +7 -10
  52. data/lib/phony/national_splitters/default.rb +9 -11
  53. data/lib/phony/national_splitters/dsl.rb +8 -18
  54. data/lib/phony/national_splitters/fixed.rb +11 -14
  55. data/lib/phony/national_splitters/none.rb +7 -11
  56. data/lib/phony/national_splitters/regex.rb +13 -17
  57. data/lib/phony/national_splitters/variable.rb +36 -38
  58. data/lib/phony/trunk_code.rb +16 -18
  59. data/lib/phony/vanity.rb +12 -13
  60. data/lib/phony.rb +84 -84
  61. metadata +5 -39
  62. data/spec/functional/config_spec.rb +0 -44
  63. data/spec/functional/plausibility_spec.rb +0 -689
  64. data/spec/lib/phony/countries_spec.rb +0 -1460
  65. data/spec/lib/phony/country_codes_spec.rb +0 -227
  66. data/spec/lib/phony/country_spec.rb +0 -104
  67. data/spec/lib/phony/dsl_spec.rb +0 -28
  68. data/spec/lib/phony/local_splitters/fixed_spec.rb +0 -56
  69. data/spec/lib/phony/local_splitters/regex_spec.rb +0 -94
  70. data/spec/lib/phony/national_code_spec.rb +0 -61
  71. data/spec/lib/phony/national_splitters/default_spec.rb +0 -34
  72. data/spec/lib/phony/national_splitters/fixed_spec.rb +0 -45
  73. data/spec/lib/phony/national_splitters/none_spec.rb +0 -28
  74. data/spec/lib/phony/national_splitters/regex_spec.rb +0 -23
  75. data/spec/lib/phony/national_splitters/variable_spec.rb +0 -35
  76. data/spec/lib/phony/trunk_code_spec.rb +0 -85
  77. data/spec/lib/phony/vanity_spec.rb +0 -30
  78. data/spec/lib/phony_spec.rb +0 -70
@@ -19,9 +19,9 @@ mobile_ndc = [
19
19
  # Mobile [4+6].
20
20
  #
21
21
  # NOTE We're explicitly denoting this as dynamic strings cannot be frozen.
22
- *%w(7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599),
22
+ '7100', '7101', '7102', '7103', '7104', '7105', '7106', '7107', '7108', '7109', '7110', '7111', '7112', '7113', '7114', '7115', '7116', '7117', '7118', '7119', '7120', '7121', '7122', '7123', '7124', '7125', '7126', '7127', '7128', '7129', '7130', '7131', '7132', '7133', '7134', '7135', '7136', '7137', '7138', '7139', '7140', '7141', '7142', '7143', '7144', '7145', '7146', '7147', '7148', '7149', '7150', '7151', '7152', '7153', '7154', '7155', '7156', '7157', '7158', '7159', '7160', '7161', '7162', '7163', '7164', '7165', '7166', '7167', '7168', '7169', '7170', '7171', '7172', '7173', '7174', '7175', '7176', '7177', '7178', '7179', '7180', '7181', '7182', '7183', '7184', '7185', '7186', '7187', '7188', '7189', '7190', '7191', '7192', '7193', '7194', '7195', '7196', '7197', '7198', '7199', '7200', '7201', '7202', '7203', '7204', '7205', '7206', '7207', '7208', '7209', '7210', '7211', '7212', '7213', '7214', '7215', '7216', '7217', '7218', '7219', '7220', '7221', '7222', '7223', '7224', '7225', '7226', '7227', '7228', '7229', '7230', '7231', '7232', '7233', '7234', '7235', '7236', '7237', '7238', '7239', '7240', '7241', '7242', '7243', '7244', '7245', '7246', '7247', '7248', '7249', '7250', '7251', '7252', '7253', '7254', '7255', '7256', '7257', '7258', '7259', '7260', '7261', '7262', '7263', '7264', '7265', '7266', '7267', '7268', '7269', '7270', '7271', '7272', '7273', '7274', '7275', '7276', '7277', '7278', '7279', '7280', '7281', '7282', '7283', '7284', '7285', '7286', '7287', '7288', '7289', '7290', '7291', '7292', '7293', '7294', '7295', '7296', '7297', '7298', '7299', '7300', '7301', '7302', '7303', '7304', '7305', '7306', '7307', '7308', '7309', '7310', '7311', '7312', '7313', '7314', '7315', '7316', '7317', '7318', '7319', '7320', '7321', '7322', '7323', '7324', '7325', '7326', '7327', '7328', '7329', '7330', '7331', '7332', '7333', '7334', '7335', '7336', '7337', '7338', '7339', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7350', '7351', '7352', '7353', '7354', '7355', '7356', '7357', '7358', '7359', '7360', '7361', '7362', '7363', '7364', '7365', '7366', '7367', '7368', '7369', '7370', '7371', '7372', '7373', '7374', '7375', '7376', '7377', '7378', '7379', '7380', '7381', '7382', '7383', '7384', '7385', '7386', '7387', '7388', '7389', '7390', '7391', '7392', '7393', '7394', '7395', '7396', '7397', '7398', '7399', '7400', '7401', '7402', '7403', '7404', '7405', '7406', '7407', '7408', '7409', '7410', '7411', '7412', '7413', '7414', '7415', '7416', '7417', '7418', '7419', '7420', '7421', '7422', '7423', '7424', '7425', '7426', '7427', '7428', '7429', '7430', '7431', '7432', '7433', '7434', '7435', '7436', '7437', '7438', '7439', '7440', '7441', '7442', '7443', '7444', '7445', '7446', '7447', '7448', '7449', '7450', '7451', '7452', '7453', '7454', '7455', '7456', '7457', '7458', '7459', '7460', '7461', '7462', '7463', '7464', '7465', '7466', '7467', '7468', '7469', '7470', '7471', '7472', '7473', '7474', '7475', '7476', '7477', '7478', '7479', '7480', '7481', '7482', '7483', '7484', '7485', '7486', '7487', '7488', '7489', '7490', '7491', '7492', '7493', '7494', '7495', '7496', '7497', '7498', '7499', '7500', '7501', '7502', '7503', '7504', '7505', '7506', '7507', '7508', '7509', '7510', '7511', '7512', '7513', '7514', '7515', '7516', '7517', '7518', '7519', '7520', '7521', '7522', '7523', '7524', '7525', '7526', '7527', '7528', '7529', '7530', '7531', '7532', '7533', '7534', '7535', '7536', '7537', '7538', '7539', '7540', '7541', '7542', '7543', '7544', '7545', '7546', '7547', '7548', '7549', '7550', '7551', '7552', '7553', '7554', '7555', '7556', '7557', '7558', '7559', '7560', '7561', '7562', '7563', '7564', '7565', '7566', '7567', '7568', '7569', '7570', '7571', '7572', '7573', '7574', '7575', '7576', '7577', '7578', '7579', '7580', '7581', '7582', '7583', '7584', '7585', '7586', '7587', '7588', '7589', '7590', '7591', '7592', '7593', '7594', '7595', '7596', '7597', '7598', '7599',
23
23
  '7624', # Isle of Man
24
- *%w(7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999)
24
+ '7700', '7701', '7702', '7703', '7704', '7705', '7706', '7707', '7708', '7709', '7710', '7711', '7712', '7713', '7714', '7715', '7716', '7717', '7718', '7719', '7720', '7721', '7722', '7723', '7724', '7725', '7726', '7727', '7728', '7729', '7730', '7731', '7732', '7733', '7734', '7735', '7736', '7737', '7738', '7739', '7740', '7741', '7742', '7743', '7744', '7745', '7746', '7747', '7748', '7749', '7750', '7751', '7752', '7753', '7754', '7755', '7756', '7757', '7758', '7759', '7760', '7761', '7762', '7763', '7764', '7765', '7766', '7767', '7768', '7769', '7770', '7771', '7772', '7773', '7774', '7775', '7776', '7777', '7778', '7779', '7780', '7781', '7782', '7783', '7784', '7785', '7786', '7787', '7788', '7789', '7790', '7791', '7792', '7793', '7794', '7795', '7796', '7797', '7798', '7799', '7800', '7801', '7802', '7803', '7804', '7805', '7806', '7807', '7808', '7809', '7810', '7811', '7812', '7813', '7814', '7815', '7816', '7817', '7818', '7819', '7820', '7821', '7822', '7823', '7824', '7825', '7826', '7827', '7828', '7829', '7830', '7831', '7832', '7833', '7834', '7835', '7836', '7837', '7838', '7839', '7840', '7841', '7842', '7843', '7844', '7845', '7846', '7847', '7848', '7849', '7850', '7851', '7852', '7853', '7854', '7855', '7856', '7857', '7858', '7859', '7860', '7861', '7862', '7863', '7864', '7865', '7866', '7867', '7868', '7869', '7870', '7871', '7872', '7873', '7874', '7875', '7876', '7877', '7878', '7879', '7880', '7881', '7882', '7883', '7884', '7885', '7886', '7887', '7888', '7889', '7890', '7891', '7892', '7893', '7894', '7895', '7896', '7897', '7898', '7899', '7900', '7901', '7902', '7903', '7904', '7905', '7906', '7907', '7908', '7909', '7910', '7911', '7912', '7913', '7914', '7915', '7916', '7917', '7918', '7919', '7920', '7921', '7922', '7923', '7924', '7925', '7926', '7927', '7928', '7929', '7930', '7931', '7932', '7933', '7934', '7935', '7936', '7937', '7938', '7939', '7940', '7941', '7942', '7943', '7944', '7945', '7946', '7947', '7948', '7949', '7950', '7951', '7952', '7953', '7954', '7955', '7956', '7957', '7958', '7959', '7960', '7961', '7962', '7963', '7964', '7965', '7966', '7967', '7968', '7969', '7970', '7971', '7972', '7973', '7974', '7975', '7976', '7977', '7978', '7979', '7980', '7981', '7982', '7983', '7984', '7985', '7986', '7987', '7988', '7989', '7990', '7991', '7992', '7993', '7994', '7995', '7996', '7997', '7998', '7999'
25
25
  ]
26
26
 
27
27
  two_digit_ndc = [
@@ -38,14 +38,14 @@ two_digit_ndc = [
38
38
  '55', # Corporate
39
39
  '56', # LIECS/VoIP
40
40
  '70', # Personal numbers
41
- '76', # Pagers (not 7624, Mobile, Isle of Man)
41
+ '76' # Pagers (not 7624, Mobile, Isle of Man)
42
42
  ]
43
43
 
44
44
  # three_digit_ndc_with_nine_digits
45
- # Non-geographic [3+6].
46
- #
47
- # '500', # Freephone (9 digits) handled in specific rule, see below.
48
- # '800', # Freephone (9 digits) handled in specific rule, see below.
45
+ # Non-geographic [3+6].
46
+ #
47
+ # '500', # Freephone (9 digits) handled in specific rule, see below.
48
+ # '800', # Freephone (9 digits) handled in specific rule, see below.
49
49
 
50
50
  three_digit_ndc = [
51
51
  # Geographic [3+7] - includes (01xx) 0 and (01xx) 1 as NDO.
@@ -125,14 +125,14 @@ three_digit_ndc = [
125
125
  '982',
126
126
  '983',
127
127
  '984',
128
- '989',
128
+ '989'
129
129
  ]
130
130
 
131
131
  # five_digit_ndc_with_nine_digits
132
- # Geographic [5+4] - includes (016977) 0 and (016977) 1 as NDO.
133
- #
134
- # '16977', # Brampton (contains both 4 and 5 digit numbers)
135
- # # 9 digits handled in specific rule, see below.
132
+ # Geographic [5+4] - includes (016977) 0 and (016977) 1 as NDO.
133
+ #
134
+ # '16977', # Brampton (contains both 4 and 5 digit numbers)
135
+ # # 9 digits handled in specific rule, see below.
136
136
 
137
137
  five_digit_ndc = [
138
138
  # Geographic [5+5] - includes (01xxxx) 0 and (01xxxx) 1 as NDO.
@@ -150,7 +150,7 @@ five_digit_ndc = [
150
150
  '17683', # Appleby
151
151
  '17684', # Pooley Bridge
152
152
  '17687', # Keswick
153
- '19467', # Gosforth
153
+ '19467' # Gosforth
154
154
  ]
155
155
 
156
156
  variable_length_number = [
@@ -198,7 +198,7 @@ variable_length_number = [
198
198
  '1946', # Whitehaven (Mixed area)
199
199
  '1949', # Whatton
200
200
  '1963', # Wincanton
201
- '1995', # Garstang
201
+ '1995' # Garstang
202
202
  ]
203
203
 
204
204
  four_digit_ndc = [
@@ -209,11 +209,11 @@ four_digit_ndc = [
209
209
  # range sub-allocated as 5-5 and one also has some 5-4.
210
210
  '1200', # Clitheroe
211
211
  '1202', # Bournemouth
212
- #1204 Bolton (see [4+6]/[4+5] areas)
212
+ # 1204 Bolton (see [4+6]/[4+5] areas)
213
213
  '1205', # Boston
214
214
  '1206', # Colchester
215
215
  '1207', # Consett
216
- #1208 Bodmin (see [4+6]/[4+5] areas)
216
+ # 1208 Bodmin (see [4+6]/[4+5] areas)
217
217
  '1209', # Redruth, Cornwall
218
218
  '1223', # Cambridge
219
219
  '1224', # Aberdeen
@@ -239,7 +239,7 @@ four_digit_ndc = [
239
239
  '1250', # Blairgowrie
240
240
  '1252', # Aldershot
241
241
  '1253', # Blackpool
242
- #1254 Blackburn (see [4+6]/[4+5] areas)
242
+ # 1254 Blackburn (see [4+6]/[4+5] areas)
243
243
  '1255', # Clacton-on-Sea
244
244
  '1256', # Basingstoke
245
245
  '1257', # Coppull, Chorley
@@ -258,7 +258,7 @@ four_digit_ndc = [
258
258
  '1273', # Brighton
259
259
  '1274', # Bradford
260
260
  '1275', # Clevedon, Bristol
261
- #1276 Camberley (see [4+6]/[4+5] areas)
261
+ # 1276 Camberley (see [4+6]/[4+5] areas)
262
262
  '1277', # Brentwood
263
263
  '1278', # Bridgwater
264
264
  '1279', # Bishop's Stortford
@@ -278,8 +278,8 @@ four_digit_ndc = [
278
278
  '1294', # Ardrossan, Ayrshire
279
279
  '1295', # Banbury
280
280
  '1296', # Aylesbury
281
- #1297 Axminster (see [4+6]/[4+5] areas)
282
- #1298 Buxton (see [4+6]/[4+5] areas)
281
+ # 1297 Axminster (see [4+6]/[4+5] areas)
282
+ # 1298 Buxton (see [4+6]/[4+5] areas)
283
283
  '1299', # Bewdley
284
284
  '1300', # Cerne Abbas, Dorset
285
285
  '1301', # Arrochar
@@ -328,8 +328,8 @@ four_digit_ndc = [
328
328
  '1360', # Killearn, Drymen
329
329
  '1361', # Duns
330
330
  '1362', # Dereham
331
- #1363 Crediton (see [4+6]/[4+5] areas)
332
- #1364 Ashburton, Devon (see [4+6]/[4+5] areas)
331
+ # 1363 Crediton (see [4+6]/[4+5] areas)
332
+ # 1364 Ashburton, Devon (see [4+6]/[4+5] areas)
333
333
  '1366', # Downham Market
334
334
  '1367', # Faringdon
335
335
  '1368', # Dunbar
@@ -345,8 +345,8 @@ four_digit_ndc = [
345
345
  '1381', # Fortrose
346
346
  '1382', # Dundee
347
347
  '1383', # Dunfermline
348
- #1384 Dudley (see [4+6]/[4+5] areas)
349
- #1386 Evesham (see [4+6]/[4+5] areas)
348
+ # 1384 Dudley (see [4+6]/[4+5] areas)
349
+ # 1386 Evesham (see [4+6]/[4+5] areas)
350
350
  '1387', # Dumfries (Mixed area)
351
351
  '1388', # Bishop Auckland, Durham and Stanhope (Eastgate) (ELNS area)
352
352
  '1389', # Dumbarton
@@ -357,13 +357,13 @@ four_digit_ndc = [
357
357
  '1398', # Dulverton, Exmoor
358
358
  '1400', # Honington
359
359
  '1403', # Horsham
360
- #1404 Honiton (see [4+6]/[4+5] areas)
360
+ # 1404 Honiton (see [4+6]/[4+5] areas)
361
361
  '1405', # Goole
362
362
  '1406', # Holbeach
363
363
  '1407', # Holyhead
364
364
  '1408', # Golspie
365
365
  '1409', # Holsworthy
366
- #1420 Alton (see [4+6]/[4+5] areas)
366
+ # 1420 Alton (see [4+6]/[4+5] areas)
367
367
  '1422', # Halifax
368
368
  '1423', # Boroughbridge and Harrogate (ELNS area)
369
369
  '1424', # Hastings
@@ -397,8 +397,8 @@ four_digit_ndc = [
397
397
  '1456', # Glenurquhart
398
398
  '1457', # Glossop
399
399
  '1458', # Glastonbury
400
- #1460 Chard, Ilminster (see [4+6]/[4+5] areas)
401
- #1461 Gretna (see [4+6]/[4+5] areas)
400
+ # 1460 Chard, Ilminster (see [4+6]/[4+5] areas)
401
+ # 1461 Gretna (see [4+6]/[4+5] areas)
402
402
  '1462', # Hitchin
403
403
  '1463', # Inverness
404
404
  '1464', # Insch
@@ -416,14 +416,14 @@ four_digit_ndc = [
416
416
  '1477', # Holmes Chapel
417
417
  '1478', # Portree, Isle of Skye
418
418
  '1479', # Grantown-on-Spey
419
- #1480 Huntingdon (see [4+6]/[4+5] areas)
419
+ # 1480 Huntingdon (see [4+6]/[4+5] areas)
420
420
  '1481', # Guernsey
421
421
  '1482', # Kingston-upon-Hull
422
422
  '1483', # Guildford
423
423
  '1484', # Huddersfield
424
424
  '1485', # Hunstanton
425
425
  '1487', # Warboys, Huntingdon
426
- #1488 Hungerford (see [4+6]/[4+5] areas)
426
+ # 1488 Hungerford (see [4+6]/[4+5] areas)
427
427
  '1489', # Bishops Waltham, Hamble Valley
428
428
  '1490', # Corwen, Gwynedd
429
429
  '1491', # Henley-on-Thames
@@ -444,10 +444,10 @@ four_digit_ndc = [
444
444
  '1509', # Loughborough
445
445
  '1520', # Lochcarron
446
446
  '1522', # Lincoln
447
- #1524 Lancaster (Mixed area) (see [4+6]/[4+5] areas)
447
+ # 1524 Lancaster (Mixed area) (see [4+6]/[4+5] areas)
448
448
  '1525', # Leighton Buzzard
449
449
  '1526', # Martin, Lincolnshire
450
- #1527 Redditch (see [4+6]/[4+5] areas)
450
+ # 1527 Redditch (see [4+6]/[4+5] areas)
451
451
  '1528', # Laggan, Badenoch
452
452
  '1529', # Sleaford, Lincolnshire
453
453
  '1530', # Coalville, Ashby-de-la-Zouch, Leicestershire
@@ -476,11 +476,11 @@ four_digit_ndc = [
476
476
  '1559', # Llandysul
477
477
  '1560', # Moscow
478
478
  '1561', # Laurencekirk
479
- #1562 Kidderminster (see [4+6]/[4+5] areas)
479
+ # 1562 Kidderminster (see [4+6]/[4+5] areas)
480
480
  '1563', # Kilmarnock
481
481
  '1564', # Lapworth, Knowle
482
482
  '1565', # Knutsford
483
- #1566 Launceston (see [4+6]/[4+5] areas)
483
+ # 1566 Launceston (see [4+6]/[4+5] areas)
484
484
  '1567', # Killin
485
485
  '1568', # Leominster
486
486
  '1569', # Stonehaven, Laurencekirk
@@ -512,7 +512,7 @@ four_digit_ndc = [
512
512
  '1600', # Monmouth
513
513
  '1603', # Norwich
514
514
  '1604', # Northampton
515
- #1606 Northwich (see [4+6]/[4+5] areas)
515
+ # 1606 Northwich (see [4+6]/[4+5] areas)
516
516
  '1608', # Chipping Norton
517
517
  '1609', # Northallerton
518
518
  '1620', # North Berwick
@@ -523,13 +523,13 @@ four_digit_ndc = [
523
523
  '1625', # Macclesfield
524
524
  '1626', # Newton Abbot
525
525
  '1628', # Maidenhead
526
- #1629 Matlock (see [4+6]/[4+5] areas)
526
+ # 1629 Matlock (see [4+6]/[4+5] areas)
527
527
  '1630', # Market Drayton
528
528
  '1631', # Oban
529
- #1632 Numbers for Drama
529
+ # 1632 Numbers for Drama
530
530
  '1633', # Newport
531
531
  '1634', # Medway
532
- #1635 Newbury (see [4+6]/[4+5] areas)
532
+ # 1635 Newbury (see [4+6]/[4+5] areas)
533
533
  '1636', # Newark-on-Trent
534
534
  '1637', # Newquay
535
535
  '1638', # Newmarket
@@ -539,7 +539,7 @@ four_digit_ndc = [
539
539
  '1643', # Minehead
540
540
  '1644', # New Galloway
541
541
  '1646', # Milford Haven
542
- #1647 Moretonhampstead (see [4+6]/[4+5] areas)
542
+ # 1647 Moretonhampstead (see [4+6]/[4+5] areas)
543
543
  '1650', # Cemmaes Road, Machynlleth
544
544
  '1651', # Oldmeldrum
545
545
  '1652', # Brigg, North Kelsey
@@ -547,7 +547,7 @@ four_digit_ndc = [
547
547
  '1654', # Machynlleth
548
548
  '1655', # Maybole
549
549
  '1656', # Bridgend
550
- #1659 Sanquhar, Nithsdale (see [4+6]/[4+5] areas)
550
+ # 1659 Sanquhar, Nithsdale (see [4+6]/[4+5] areas)
551
551
  '1661', # Prudhoe, Northumberland
552
552
  '1663', # New Mills
553
553
  '1664', # Melton Mowbray
@@ -578,7 +578,7 @@ four_digit_ndc = [
578
578
  '1691', # Oswestry
579
579
  '1692', # North Walsham
580
580
  '1694', # Church Stretton
581
- #1695 Skelmersdale (see [4+6]/[4+5] areas)
581
+ # 1695 Skelmersdale (see [4+6]/[4+5] areas)
582
582
  '1697', # Brampton (Mixed area)
583
583
  '1698', # Motherwell
584
584
  '1700', # Rothesay
@@ -594,7 +594,7 @@ four_digit_ndc = [
594
594
  '1723', # Scarborough
595
595
  '1724', # Scunthorpe
596
596
  '1725', # Rockbourne
597
- #1726 St Austell (see [4+6]/[4+5] areas)
597
+ # 1726 St Austell (see [4+6]/[4+5] areas)
598
598
  '1727', # St Albans
599
599
  '1728', # Saxmundham
600
600
  '1729', # Settle, Ribblesdale
@@ -606,13 +606,13 @@ four_digit_ndc = [
606
606
  '1738', # Perth
607
607
  '1740', # Sedgefield
608
608
  '1743', # Shrewsbury
609
- #1744 St Helens (see [4+6]/[4+5] areas)
609
+ # 1744 St Helens (see [4+6]/[4+5] areas)
610
610
  '1745', # Rhyl
611
611
  '1746', # Bridgnorth, Shropshire
612
612
  '1747', # Shaftesbury
613
613
  '1748', # Richmond
614
614
  '1749', # Shepton Mallet
615
- #1750 Selkirk (see [4+6]/[4+5] areas)
615
+ # 1750 Selkirk (see [4+6]/[4+5] areas)
616
616
  '1751', # Pickering
617
617
  '1752', # Plymouth
618
618
  '1753', # Slough
@@ -628,7 +628,7 @@ four_digit_ndc = [
628
628
  '1765', # Ripon
629
629
  '1766', # Porthmadog
630
630
  '1767', # Sandy
631
- #1768 Penrith (Mixed area) (see [4+6]/[4+5] areas)
631
+ # 1768 Penrith (Mixed area) (see [4+6]/[4+5] areas)
632
632
  '1769', # South Molton
633
633
  '1770', # Isle of Arran
634
634
  '1771', # Maud
@@ -667,7 +667,7 @@ four_digit_ndc = [
667
667
  '1823', # Taunton
668
668
  '1824', # Ruthin, Vale of Clwyd
669
669
  '1825', # Uckfield
670
- #1827 Tamworth (see [4+6]/[4+5] areas)
670
+ # 1827 Tamworth (see [4+6]/[4+5] areas)
671
671
  '1828', # Coupar Angus, Tayside
672
672
  '1829', # Tarporley
673
673
  '1830', # Kirkwhelpington
@@ -675,7 +675,7 @@ four_digit_ndc = [
675
675
  '1833', # Barnard Castle, Teesdale
676
676
  '1834', # Narberth, Tenby
677
677
  '1835', # St Boswells
678
- #1837 Okehampton (see [4+6]/[4+5] areas)
678
+ # 1837 Okehampton (see [4+6]/[4+5] areas)
679
679
  '1838', # Dalmally, Tyndrum
680
680
  '1840', # Camelford, Tintagel
681
681
  '1841', # Padstow, Newquay
@@ -712,7 +712,7 @@ four_digit_ndc = [
712
712
  '1880', # Tarbert
713
713
  '1882', # Kinloch Rannoch, Tummel Bridge
714
714
  '1883', # Caterham
715
- #1884 Tiverton (see [4+6]/[4+5] areas)
715
+ # 1884 Tiverton (see [4+6]/[4+5] areas)
716
716
  '1885', # Pencombe
717
717
  '1886', # Bromyard, Teme Valley
718
718
  '1887', # Aberfeldy, Tay Valley
@@ -723,11 +723,11 @@ four_digit_ndc = [
723
723
  '1895', # Uxbridge
724
724
  '1896', # Galashiels, Tweed
725
725
  '1899', # Biggar, Tweed
726
- #1900 Workington (see [4+6]/[4+5] areas)
726
+ # 1900 Workington (see [4+6]/[4+5] areas)
727
727
  '1902', # Wolverhampton
728
728
  '1903', # Worthing
729
729
  '1904', # York
730
- #1905 Worcester (see [4+6]/[4+5] areas)
730
+ # 1905 Worcester (see [4+6]/[4+5] areas)
731
731
  '1908', # Milton Keynes, Wolverton
732
732
  '1909', # Worksop
733
733
  '1920', # Ware
@@ -742,7 +742,7 @@ four_digit_ndc = [
742
742
  '1932', # Weybridge
743
743
  '1933', # Wellingborough
744
744
  '1934', # Weston-super-Mare
745
- #1935 Yeovil (see [4+6]/[4+5] areas)
745
+ # 1935 Yeovil (see [4+6]/[4+5] areas)
746
746
  '1937', # Wetherby
747
747
  '1938', # Welshpool
748
748
  '1939', # Wem
@@ -750,10 +750,10 @@ four_digit_ndc = [
750
750
  '1943', # Guiseley, Wharfedale
751
751
  '1944', # West Heslerton
752
752
  '1945', # Wisbech
753
- #1946 Whitehaven (Mixed area) (see [4+6]/[4+5] areas)
753
+ # 1946 Whitehaven (Mixed area) (see [4+6]/[4+5] areas)
754
754
  '1947', # Whitby
755
755
  '1948', # Whitchurch
756
- #1949 Whatton (see [4+6]/[4+5] areas)
756
+ # 1949 Whatton (see [4+6]/[4+5] areas)
757
757
  '1950', # Sandwick, Yell
758
758
  '1951', # Colonsay
759
759
  '1952', # Telford, Wellington
@@ -763,7 +763,7 @@ four_digit_ndc = [
763
763
  '1957', # Mid Yell, Yell
764
764
  '1959', # Westerham, West Kent
765
765
  '1962', # Winchester
766
- #1963 Wincanton (see [4+6]/[4+5] areas)
766
+ # 1963 Wincanton (see [4+6]/[4+5] areas)
767
767
  '1964', # Hornsea and Patrington, Withernsea (ELNS area)
768
768
  '1967', # Strontian
769
769
  '1968', # Penicuik, West Linton
@@ -788,20 +788,20 @@ four_digit_ndc = [
788
788
  '1992', # Lea Valley, Waltham Cross
789
789
  '1993', # Witney
790
790
  '1994', # St Clears, West Wales
791
- #1995 Garstang, Wyre (see [4+6]/[4+5] areas)
792
- '1997', # Strathpeffer, Wyvis
791
+ # 1995 Garstang, Wyre (see [4+6]/[4+5] areas)
792
+ '1997' # Strathpeffer, Wyvis
793
793
  ]
794
794
 
795
795
  Phony.define do
796
796
  country '44',
797
- trunk('0') |
798
- one_of(mobile_ndc) >> split(6) | # 4-6
799
- one_of(two_digit_ndc) >> split(4,4) | # 2-4-4
800
- match(/^([58]00)\d{6}$/) >> split(6) | # 3-6, Special handling for 500 and 800.
801
- one_of(three_digit_ndc) >> split(3,4) | # 3-3-4
802
- match(/^(16977)\d{4}$/) >> split(4) | # 5-4, Special handling for 16977.
803
- one_of(five_digit_ndc) >> split(5) | # 5-5
804
- one_of(variable_length_number) >> split(5..6) | # 4-6 and 4-5, in 40 areas.
805
- one_of(four_digit_ndc) >> split(6) | # 4-6
806
- match(/^([135789]\d{3})/) >> split(6) # Catchall for plausible unallocated numbers.
797
+ trunk('0') |
798
+ one_of(mobile_ndc) >> split(6) | # 4-6
799
+ one_of(two_digit_ndc) >> split(4, 4) | # 2-4-4
800
+ match(/^([58]00)\d{6}$/) >> split(6) | # 3-6, Special handling for 500 and 800.
801
+ one_of(three_digit_ndc) >> split(3, 4) | # 3-3-4
802
+ match(/^(16977)\d{4}$/) >> split(4) | # 5-4, Special handling for 16977.
803
+ one_of(five_digit_ndc) >> split(5) | # 5-5
804
+ one_of(variable_length_number) >> split(5..6) | # 4-6 and 4-5, in 40 areas.
805
+ one_of(four_digit_ndc) >> split(6) | # 4-6
806
+ match(/^([135789]\d{3})/) >> split(6) # Catchall for plausible unallocated numbers.
807
807
  end
@@ -4,50 +4,49 @@
4
4
  # https://www.numberingplans.com/?page=dialling&sub=areacodes
5
5
  # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=UY
6
6
 
7
- ndcs_with_7_subscriber_numbers = %w(2 4)
7
+ ndcs_with_7_subscriber_numbers = %w[2 4]
8
8
 
9
- ndcs_with_6_subscriber_numbers = %w(
10
- 21
11
- 22
12
- 23
13
- 24
14
- 25
15
- 26
16
- 27
17
- 29
18
- 42
19
- )
20
-
21
- ndcs_with_5_subscriber_numbers = %w(
22
- 433
23
- 434
24
- 436
25
- 437
26
- 438
27
- 443
28
- 444
29
- 445
30
- 447
31
- 452
32
- 453
33
- 455
34
- 462
35
- 463
36
- 464
37
- 472
38
- 473
39
- )
9
+ ndcs_with_6_subscriber_numbers = %w[
10
+ 21
11
+ 22
12
+ 23
13
+ 24
14
+ 25
15
+ 26
16
+ 27
17
+ 29
18
+ 42
19
+ ]
40
20
 
21
+ ndcs_with_5_subscriber_numbers = %w[
22
+ 433
23
+ 434
24
+ 436
25
+ 437
26
+ 438
27
+ 443
28
+ 444
29
+ 445
30
+ 447
31
+ 452
32
+ 453
33
+ 455
34
+ 462
35
+ 463
36
+ 464
37
+ 472
38
+ 473
39
+ ]
41
40
 
42
41
  Phony.define do
43
42
  country '598',
44
- one_of('800') >> split(3,2) | # freephone
45
- one_of('805') >> split(3,2) | # shared cost
46
- one_of(%w(900 901 902 903 904 905 906 907 908)) >> split(3,2) | # premium rate
47
- one_of('909') >> split(3,2) | # ISP
48
- one_of(ndcs_with_5_subscriber_numbers) >> split(3,2) |
49
- one_of(ndcs_with_6_subscriber_numbers) >> split(3,3) |
50
- one_of(%w(93 94 95 96 97 98 99)) >> split(3,3) | # mobile
51
- one_of(ndcs_with_7_subscriber_numbers) >> split(3,4) |
52
- fixed(2) >> split(3,3)
43
+ one_of('800') >> split(3, 2) | # freephone
44
+ one_of('805') >> split(3, 2) | # shared cost
45
+ one_of(%w[900 901 902 903 904 905 906 907 908]) >> split(3, 2) | # premium rate
46
+ one_of('909') >> split(3, 2) | # ISP
47
+ one_of(ndcs_with_5_subscriber_numbers) >> split(3, 2) |
48
+ one_of(ndcs_with_6_subscriber_numbers) >> split(3, 3) |
49
+ one_of(%w[93 94 95 96 97 98 99]) >> split(3, 3) | # mobile
50
+ one_of(ndcs_with_7_subscriber_numbers) >> split(3, 4) |
51
+ fixed(2) >> split(3, 3)
53
52
  end
@@ -70,14 +70,14 @@ ndcs_with_7_subscriber_digits = [
70
70
  '294', # Trà Vinh Province
71
71
  '296', # An Giang Province
72
72
  '297', # Kiên Giang Province
73
- '299', # Sóc Trăng Province
73
+ '299' # Sóc Trăng Province
74
74
  ]
75
75
 
76
76
  ndcs_with_8_subscriber_digits = [
77
77
  '4', # Hà Nội Province
78
78
  '24', # Hà Nội Province
79
79
  '28', # Hồ Chí Minh Province
80
- '8', # Hồ Chí Minh Province
80
+ '8' # Hồ Chí Minh Province
81
81
  ]
82
82
 
83
83
  mobile = [
@@ -92,7 +92,7 @@ mobile = [
92
92
  '52', # Vietnammobile
93
93
  '56', # Vietnamobile
94
94
  '58', # Vietnamobile (previously known as HT Mobile)
95
- '59', # GTel (traded as Beeline)
95
+ '59', # GTel (traded as Beeline)
96
96
  '70', # MobiFone
97
97
  '76', # MobiFone
98
98
  '77', # MobiFone
@@ -106,7 +106,7 @@ mobile = [
106
106
  '86', # Viettel
107
107
  '87', # Itelecom
108
108
  '88', # Vinaphone
109
- '89', # MobiFone,
109
+ '89', # MobiFone,
110
110
  '90', # MobiFone
111
111
  '91', # Vinaphone
112
112
  '92', # Vietnamobile (previously known as HT Mobile)
@@ -115,22 +115,23 @@ mobile = [
115
115
  '96', # previously EVN Telecom, now Viettel Mobile
116
116
  '97', # Viettel Mobile
117
117
  '98', # Viettel Mobile
118
- '99', # Gmobile (traded as Beeline)
118
+ '99' # Gmobile (traded as Beeline)
119
119
  ]
120
120
 
121
- mobile_with_trunk = (mobile).map{ |num| "0#{num}" }
121
+ mobile_with_trunk = mobile.map { |num| "0#{num}" }
122
122
 
123
123
  Phony.define do
124
124
  country '84',
125
- trunk('0') |
126
- one_of(mobile) >> split(4..8)|
127
- one_of(ndcs_with_7_subscriber_digits) >> split(3,4) |
128
- one_of(ndcs_with_8_subscriber_digits) >> split(4,4) |
129
- one_of(mobile_with_trunk) >> split(5..8)|
130
- one_of('1900') >> matched_split(
131
- /\A\d{4}\z/ => [4],
132
- /\A\d{6}\z/ => [6]) | # Premium rate
133
- # Govt reserved
134
- fixed(80) >> split(5) |
135
- fixed(69) >> split(1,5)
125
+ trunk('0') |
126
+ one_of(mobile) >> split(4..8) |
127
+ one_of(ndcs_with_7_subscriber_digits) >> split(3, 4) |
128
+ one_of(ndcs_with_8_subscriber_digits) >> split(4, 4) |
129
+ one_of(mobile_with_trunk) >> split(5..8) |
130
+ one_of('1900') >> matched_split(
131
+ /\A\d{4}\z/ => [4],
132
+ /\A\d{6}\z/ => [6]
133
+ ) | # Premium rate
134
+ # Govt reserved
135
+ fixed(80) >> split(5) |
136
+ fixed(69) >> split(1, 5)
136
137
  end