telephone_number 1.4.6 → 1.4.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +0 -1
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +4 -0
  5. data/data/geocoding/de/352.dat +0 -0
  6. data/data/geocoding/de/352.txt +0 -1
  7. data/data/geocoding/de/43.dat +0 -0
  8. data/data/geocoding/de/43.txt +2 -0
  9. data/data/geocoding/de/49.dat +0 -0
  10. data/data/geocoding/de/49.txt +3 -3
  11. data/data/geocoding/en/1.dat +0 -0
  12. data/data/geocoding/en/1.txt +45 -7
  13. data/data/geocoding/en/212.dat +0 -0
  14. data/data/geocoding/en/212.txt +4 -4
  15. data/data/geocoding/en/221.dat +0 -0
  16. data/data/geocoding/en/221.txt +7 -1
  17. data/data/geocoding/en/224.dat +0 -0
  18. data/data/geocoding/en/224.txt +1 -1
  19. data/data/geocoding/en/225.dat +0 -0
  20. data/data/geocoding/en/225.txt +22 -12
  21. data/data/geocoding/en/233.dat +0 -0
  22. data/data/geocoding/en/233.txt +1 -0
  23. data/data/geocoding/en/234.dat +0 -0
  24. data/data/geocoding/en/234.txt +16 -1
  25. data/data/geocoding/en/236.dat +0 -0
  26. data/data/geocoding/en/236.txt +15 -0
  27. data/data/geocoding/en/252.dat +0 -0
  28. data/data/geocoding/en/252.txt +0 -1
  29. data/data/geocoding/en/264.dat +0 -0
  30. data/data/geocoding/en/264.txt +2 -0
  31. data/data/geocoding/en/267.dat +0 -0
  32. data/data/geocoding/en/267.txt +1 -0
  33. data/data/geocoding/en/290.dat +0 -0
  34. data/data/geocoding/en/290.txt +6 -1
  35. data/data/geocoding/en/352.dat +0 -0
  36. data/data/geocoding/en/352.txt +0 -1
  37. data/data/geocoding/en/370.dat +0 -0
  38. data/data/geocoding/en/370.txt +9 -2
  39. data/data/geocoding/en/374.dat +0 -0
  40. data/data/geocoding/en/374.txt +0 -5
  41. data/data/geocoding/en/380.dat +0 -0
  42. data/data/geocoding/en/380.txt +1 -1
  43. data/data/geocoding/en/389.dat +0 -0
  44. data/data/geocoding/en/389.txt +28 -2
  45. data/data/geocoding/en/421.dat +0 -0
  46. data/data/geocoding/en/421.txt +15 -14
  47. data/data/geocoding/en/43.dat +0 -0
  48. data/data/geocoding/en/43.txt +2 -0
  49. data/data/geocoding/en/44.dat +0 -0
  50. data/data/geocoding/en/44.txt +15 -2
  51. data/data/geocoding/en/49.dat +0 -0
  52. data/data/geocoding/en/49.txt +3 -3
  53. data/data/geocoding/en/504.dat +0 -0
  54. data/data/geocoding/en/504.txt +76 -1
  55. data/data/geocoding/en/54.dat +0 -0
  56. data/data/geocoding/en/54.txt +18 -3
  57. data/data/geocoding/en/56.dat +0 -0
  58. data/data/geocoding/en/56.txt +37 -1
  59. data/data/geocoding/en/58.dat +0 -0
  60. data/data/geocoding/en/58.txt +21 -12
  61. data/data/geocoding/en/593.dat +0 -0
  62. data/data/geocoding/en/593.txt +21 -0
  63. data/data/geocoding/en/595.dat +0 -0
  64. data/data/geocoding/en/595.txt +73 -0
  65. data/data/geocoding/en/598.dat +0 -0
  66. data/data/geocoding/en/598.txt +41 -0
  67. data/data/geocoding/en/599.dat +0 -0
  68. data/data/geocoding/en/599.txt +8 -2
  69. data/data/geocoding/en/60.dat +0 -0
  70. data/data/geocoding/en/60.txt +9 -8
  71. data/data/geocoding/en/61.dat +0 -0
  72. data/data/geocoding/en/61.txt +20671 -1999
  73. data/data/geocoding/en/63.dat +0 -0
  74. data/data/geocoding/en/63.txt +61 -0
  75. data/data/geocoding/en/64.dat +0 -0
  76. data/data/geocoding/en/64.txt +2862 -108
  77. data/data/geocoding/en/66.dat +0 -0
  78. data/data/geocoding/en/66.txt +4 -0
  79. data/data/geocoding/en/670.dat +0 -0
  80. data/data/geocoding/en/670.txt +31 -0
  81. data/data/geocoding/en/672.dat +0 -0
  82. data/data/geocoding/en/672.txt +18 -0
  83. data/data/geocoding/en/678.dat +0 -0
  84. data/data/geocoding/en/678.txt +27 -0
  85. data/data/geocoding/en/680.dat +0 -0
  86. data/data/geocoding/en/680.txt +1 -1
  87. data/data/geocoding/en/685.dat +0 -0
  88. data/data/geocoding/en/685.txt +27 -0
  89. data/data/geocoding/en/686.dat +0 -0
  90. data/data/geocoding/en/686.txt +0 -1
  91. data/data/geocoding/en/689.dat +0 -0
  92. data/data/geocoding/en/689.txt +24 -0
  93. data/data/geocoding/en/690.dat +0 -0
  94. data/data/geocoding/en/690.txt +17 -0
  95. data/data/geocoding/en/7.dat +0 -0
  96. data/data/geocoding/en/7.txt +3 -0
  97. data/data/geocoding/en/81.dat +0 -0
  98. data/data/geocoding/en/81.txt +10 -2
  99. data/data/geocoding/en/850.dat +0 -0
  100. data/data/geocoding/en/850.txt +31 -0
  101. data/data/geocoding/en/880.dat +0 -0
  102. data/data/geocoding/en/880.txt +247 -613
  103. data/data/geocoding/en/92.dat +0 -0
  104. data/data/geocoding/en/92.txt +760 -0
  105. data/data/geocoding/en/94.dat +0 -0
  106. data/data/geocoding/en/94.txt +2 -2
  107. data/data/geocoding/en/961.dat +0 -0
  108. data/data/geocoding/en/961.txt +23 -0
  109. data/data/geocoding/en/962.dat +0 -0
  110. data/data/geocoding/en/962.txt +24 -2
  111. data/data/geocoding/en/963.dat +0 -0
  112. data/data/geocoding/en/963.txt +35 -0
  113. data/data/geocoding/en/967.dat +0 -0
  114. data/data/geocoding/en/967.txt +98 -0
  115. data/data/geocoding/en/970.dat +0 -0
  116. data/data/geocoding/en/970.txt +29 -0
  117. data/data/geocoding/en/993.dat +0 -0
  118. data/data/geocoding/en/993.txt +5 -0
  119. data/data/geocoding/en/995.dat +0 -0
  120. data/data/geocoding/en/995.txt +91 -0
  121. data/data/geocoding/es/52.dat +0 -0
  122. data/data/geocoding/es/52.txt +16 -16
  123. data/data/geocoding/es/54.dat +0 -0
  124. data/data/geocoding/es/54.txt +18 -3
  125. data/data/geocoding/es/56.dat +0 -0
  126. data/data/geocoding/es/56.txt +37 -1
  127. data/data/geocoding/es/58.dat +0 -0
  128. data/data/geocoding/es/58.txt +21 -12
  129. data/data/geocoding/fr/212.dat +0 -0
  130. data/data/geocoding/fr/212.txt +4 -4
  131. data/data/geocoding/fr/225.dat +0 -0
  132. data/data/geocoding/fr/225.txt +22 -12
  133. data/data/geocoding/fr/290.dat +0 -0
  134. data/data/geocoding/fr/290.txt +6 -1
  135. data/data/geocoding/fr/352.dat +0 -0
  136. data/data/geocoding/fr/352.txt +0 -1
  137. data/data/geocoding/hy/374.dat +0 -0
  138. data/data/geocoding/hy/374.txt +0 -5
  139. data/data/geocoding/ja/81.dat +0 -0
  140. data/data/geocoding/ja/81.txt +9 -1
  141. data/data/geocoding/ru/374.dat +0 -0
  142. data/data/geocoding/ru/374.txt +0 -6
  143. data/data/geocoding/ru/7.dat +0 -0
  144. data/data/geocoding/ru/7.txt +92 -1
  145. data/data/geocoding/th/66.dat +0 -0
  146. data/data/geocoding/th/66.txt +4 -0
  147. data/data/telephone_number_data_file.dat +0 -0
  148. data/data/telephone_number_data_file.xml +3182 -1588
  149. data/data/timezones/map_data.dat +0 -0
  150. data/data/timezones/map_data.txt +134 -49
  151. data/lib/importers/geo_location_data_importer.rb +1 -1
  152. data/lib/telephone_number.rb +0 -1
  153. data/lib/telephone_number/country.rb +22 -9
  154. data/lib/telephone_number/version.rb +1 -1
  155. data/telephone_number.gemspec +1 -0
  156. metadata +42 -4
  157. data/lib/utilities/hash.rb +0 -47
Binary file
@@ -15,7 +15,7 @@
15
15
  # Generated from:
16
16
  # Internal statistics data (2018-06-12).
17
17
 
18
- 1|America/Adak&America/Anchorage&America/Anguilla&America/Antigua&America/Barbados&America/Boise&America/Cayman&America/Chicago&America/Denver&America/Dominica&America/Edmonton&America/Fort_Nelson&America/Grand_Turk&America/Grenada&America/Halifax&America/Jamaica&America/Juneau&America/Los_Angeles&America/Lower_Princes&America/Montserrat&America/Nassau&America/New_York&America/North_Dakota/Center&America/Phoenix&America/Port_of_Spain&America/Puerto_Rico&America/Santo_Domingo&America/St_Johns&America/St_Kitts&America/St_Lucia&America/St_Thomas&America/St_Vincent&America/Toronto&America/Tortola&America/Vancouver&America/Winnipeg&Atlantic/Bermuda&Pacific/Guam&Pacific/Honolulu&Pacific/Pago_Pago&Pacific/Saipan
18
+ 1|America/Adak&America/Anchorage&America/Anguilla&America/Antigua&America/Barbados&America/Boise&America/Cayman&America/Chicago&America/Denver&America/Dominica&America/Edmonton&America/Fort_Nelson&America/Grand_Turk&America/Grenada&America/Halifax&America/Jamaica&America/Juneau&America/Los_Angeles&America/Lower_Princes&America/Montserrat&America/Nassau&America/New_York&America/North_Dakota/Center&America/Phoenix&America/Port_of_Spain&America/Puerto_Rico&America/Regina&America/Santo_Domingo&America/St_Johns&America/St_Kitts&America/St_Lucia&America/St_Thomas&America/St_Vincent&America/Toronto&America/Tortola&America/Vancouver&America/Winnipeg&Atlantic/Bermuda&Pacific/Guam&Pacific/Honolulu&Pacific/Pago_Pago&Pacific/Saipan
19
19
  1201|America/New_York
20
20
  1202|America/New_York
21
21
  1203|America/New_York
@@ -641,7 +641,7 @@
641
641
  1303|America/Denver
642
642
  1304|America/New_York
643
643
  1305|America/New_York
644
- 1306|America/Winnipeg
644
+ 1306|America/Regina
645
645
  1307|America/Denver
646
646
  1308|America/Chicago
647
647
  1308235|America/Denver
@@ -681,6 +681,7 @@
681
681
  1321|America/New_York
682
682
  1323|America/Los_Angeles
683
683
  1325|America/Chicago
684
+ 1326|America/New_York
684
685
  1330|America/New_York
685
686
  1331|America/Chicago
686
687
  1332|America/New_York
@@ -700,6 +701,8 @@
700
701
  1361|America/Chicago
701
702
  1364|America/New_York
702
703
  1365|America/Toronto
704
+ 1367|America/Toronto
705
+ 1368|America/Edmonton
703
706
  1380|America/New_York
704
707
  1385|America/Denver
705
708
  1386|America/New_York
@@ -914,12 +917,14 @@
914
917
  1442|America/Los_Angeles
915
918
  1443|America/New_York
916
919
  1445|America/New_York
920
+ 1447|America/Chicago
917
921
  1450|America/Toronto
918
922
  1458|America/Los_Angeles
919
923
  1463|America/New_York
920
924
  1469|America/Chicago
921
925
  1470|America/New_York
922
926
  1473|America/Grenada
927
+ 1474|America/Winnipeg
923
928
  1475|America/New_York
924
929
  1478|America/New_York
925
930
  1479|America/Chicago
@@ -964,6 +969,7 @@
964
969
  1567|America/New_York
965
970
  1570|America/New_York
966
971
  1571|America/New_York
972
+ 1572|America/Chicago
967
973
  1573|America/Chicago
968
974
  1574|America/New_York
969
975
  1574772|America/Chicago
@@ -1158,11 +1164,13 @@
1158
1164
  1620384|America/Denver
1159
1165
  1623|America/Phoenix
1160
1166
  1626|America/Los_Angeles
1167
+ 1628|America/Los_Angeles
1161
1168
  1629|America/Chicago
1162
1169
  1630|America/Chicago
1163
1170
  1631|America/New_York
1164
1171
  1636|America/Chicago
1165
- 1639|America/Winnipeg
1172
+ 1639|America/Regina
1173
+ 1640|America/New_York
1166
1174
  1641|America/Chicago
1167
1175
  1646|America/New_York
1168
1176
  1647|America/Toronto
@@ -1171,6 +1179,7 @@
1171
1179
  1651|America/Chicago
1172
1180
  1657|America/Los_Angeles
1173
1181
  1658|America/Jamaica
1182
+ 1659|America/Chicago
1174
1183
  1660|America/Chicago
1175
1184
  1661|America/Los_Angeles
1176
1185
  1662|America/Chicago
@@ -1603,6 +1612,8 @@
1603
1612
  1831|America/Los_Angeles
1604
1613
  1832|America/Chicago
1605
1614
  1838|America/New_York
1615
+ 1839|America/New_York
1616
+ 1840|America/Los_Angeles
1606
1617
  1843|America/New_York
1607
1618
  1845|America/New_York
1608
1619
  1847|America/Chicago
@@ -1966,6 +1977,7 @@
1966
1977
  1939|America/Puerto_Rico
1967
1978
  1940|America/Chicago
1968
1979
  1941|America/New_York
1980
+ 1945|America/Chicago
1969
1981
  1947|America/New_York
1970
1982
  1949|America/Los_Angeles
1971
1983
  1951|America/Los_Angeles
@@ -2064,16 +2076,15 @@
2064
2076
  297|America/Aruba
2065
2077
  298|Atlantic/Faeroe
2066
2078
  299|America/Godthab&America/Scoresbysund&America/Thule
2079
+ 2991|America/Godthab
2080
+ 2992|America/Godthab
2067
2081
  2993|America/Godthab
2082
+ 2994|America/Godthab
2083
+ 2995|America/Godthab
2068
2084
  2996|America/Godthab
2069
2085
  2998|America/Godthab
2070
- 29991|America/Godthab
2071
- 29992|America/Godthab
2072
- 29994|America/Godthab
2073
- 29995|America/Godthab
2074
- 29996|America/Godthab
2086
+ 2999|America/Godthab
2075
2087
  29997|America/Thule
2076
- 29998|America/Godthab
2077
2088
  29999|America/Scoresbysund
2078
2089
  30|Europe/Athens
2079
2090
  31|Europe/Amsterdam
@@ -2092,6 +2103,7 @@
2092
2103
  34928|Atlantic/Canary
2093
2104
  350|Europe/Gibraltar
2094
2105
  351|Atlantic/Azores&Europe/Lisbon
2106
+ 3511|Atlantic/Azores&Europe/Lisbon
2095
2107
  3512|Europe/Lisbon
2096
2108
  351292|Atlantic/Azores
2097
2109
  351295|Atlantic/Azores
@@ -2168,6 +2180,33 @@
2168
2180
  441534|Europe/Jersey
2169
2181
  441624|Europe/Isle_of_Man
2170
2182
  442|Europe/London
2183
+ 443|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2184
+ 445|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2185
+ 4470|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2186
+ 4471|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2187
+ 4472|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2188
+ 4473|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2189
+ 4474|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2190
+ 4475|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2191
+ 44760|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2192
+ 44762|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2193
+ 44763|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2194
+ 447640|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2195
+ 447641|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2196
+ 447643|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2197
+ 447644|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2198
+ 447646|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2199
+ 44765|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2200
+ 44766|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2201
+ 44767|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2202
+ 44768|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2203
+ 447693|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2204
+ 447699|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2205
+ 4477|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2206
+ 4478|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2207
+ 4479|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2208
+ 448|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2209
+ 449|Europe/Guernsey&Europe/Isle_of_Man&Europe/London
2171
2210
  45|Europe/Copenhagen
2172
2211
  46|Europe/Stockholm
2173
2212
  47|Arctic/Longyearbyen&Europe/Oslo
@@ -2822,21 +2861,19 @@
2822
2861
  5598|America/Sao_Paulo
2823
2862
  5599|America/Sao_Paulo
2824
2863
  56|America/Santiago&Pacific/Easter
2864
+ 561|America/Santiago
2825
2865
  562|America/Santiago
2826
2866
  5632|Pacific/Easter
2867
+ 56322|America/Santiago
2868
+ 56323|America/Santiago
2827
2869
  5633|America/Santiago
2828
2870
  5634|America/Santiago
2829
2871
  5635|America/Santiago
2830
- 5641|America/Santiago
2831
- 5642|America/Santiago
2832
- 5643|America/Santiago
2833
- 5645|America/Santiago
2872
+ 564|America/Santiago
2834
2873
  565|America/Santiago
2835
- 5663|America/Santiago
2836
- 5664|America/Santiago
2837
- 5665|America/Santiago
2838
- 5667|America/Santiago
2874
+ 566|America/Santiago
2839
2875
  567|America/Santiago
2876
+ 568|America/Santiago
2840
2877
  569|America/Santiago
2841
2878
  57|America/Bogota
2842
2879
  58|America/Caracas
@@ -2844,6 +2881,7 @@
2844
2881
  591|America/La_Paz
2845
2882
  592|America/Guyana
2846
2883
  593|America/Guayaquil&Pacific/Galapagos
2884
+ 5931|America/Guayaquil&Pacific/Galapagos
2847
2885
  5932|America/Guayaquil
2848
2886
  5933|America/Guayaquil
2849
2887
  5934|America/Guayaquil
@@ -2851,18 +2889,21 @@
2851
2889
  59352|America/Guayaquil&Pacific/Galapagos
2852
2890
  5936|America/Guayaquil
2853
2891
  5937|America/Guayaquil
2892
+ 5939|America/Guayaquil
2854
2893
  594|America/Cayenne
2855
2894
  595|America/Asuncion
2856
2895
  596|America/Martinique
2857
2896
  597|America/Paramaribo
2858
2897
  598|America/Montevideo
2859
2898
  599|America/Curacao&America/Kralendijk
2860
- 599318|America/Kralendijk
2861
- 599416|America/Kralendijk
2899
+ 5993|America/Kralendijk
2900
+ 5994|America/Kralendijk
2901
+ 5996|America/Curacao
2862
2902
  5997|America/Kralendijk
2863
2903
  5999|America/Curacao
2864
2904
  60|Asia/Kuching
2865
2905
  61|Australia/Adelaide&Australia/Eucla&Australia/Lord_Howe&Australia/Perth&Australia/Sydney&Indian/Christmas&Indian/Cocos
2906
+ 611|Australia/Sydney
2866
2907
  612|Australia/Sydney
2867
2908
  61255007|Australia/Lord_Howe
2868
2909
  61255053|Australia/Lord_Howe
@@ -2887,6 +2928,7 @@
2887
2928
  61265632|Australia/Lord_Howe
2888
2929
  61265998|Australia/Lord_Howe
2889
2930
  613|Australia/Sydney
2931
+ 614|Australia/Sydney
2890
2932
  617|Australia/Sydney
2891
2933
  618510|Australia/Adelaide&Australia/Perth
2892
2934
  61851001|Indian/Christmas
@@ -2895,13 +2937,60 @@
2895
2937
  61851031|Indian/Cocos
2896
2938
  61851059|Indian/Christmas
2897
2939
  61851060|Indian/Cocos
2940
+ 61851087|Australia/Perth
2941
+ 61851088|Indian/Christmas
2942
+ 61851089|Indian/Cocos
2943
+ 6185109|Australia/Perth
2944
+ 618511|Australia/Perth
2945
+ 61851100|Australia/Adelaide&Australia/Perth
2898
2946
  61851116|Australia/Adelaide&Australia/Perth
2899
2947
  61851117|Indian/Christmas
2900
2948
  61851118|Indian/Cocos
2901
2949
  61851119|Australia/Adelaide&Australia/Perth
2902
2950
  6185112|Australia/Adelaide&Australia/Perth
2903
2951
  6185113|Australia/Adelaide&Australia/Perth
2904
- 6185114|Australia/Adelaide&Australia/Perth
2952
+ 61851140|Australia/Adelaide&Australia/Perth
2953
+ 61851141|Australia/Adelaide&Australia/Perth
2954
+ 61851142|Australia/Adelaide&Australia/Perth
2955
+ 61851143|Australia/Adelaide&Australia/Perth
2956
+ 61851144|Australia/Adelaide&Australia/Perth
2957
+ 61851146|Indian/Christmas
2958
+ 61851156|Australia/Adelaide&Australia/Perth
2959
+ 61851158|Australia/Adelaide&Australia/Perth
2960
+ 61851175|Indian/Christmas
2961
+ 61851176|Indian/Cocos
2962
+ 61851185|Australia/Adelaide&Australia/Perth
2963
+ 61851187|Australia/Adelaide&Australia/Perth
2964
+ 6185120|Australia/Perth
2965
+ 61851204|Indian/Christmas
2966
+ 61851205|Australia/Sydney
2967
+ 61851209|Australia/Adelaide&Australia/Perth
2968
+ 6185121|Australia/Adelaide&Australia/Perth
2969
+ 61851221|Australia/Adelaide&Australia/Perth
2970
+ 61851222|Indian/Christmas
2971
+ 61851223|Indian/Cocos
2972
+ 61851224|Australia/Perth
2973
+ 61851225|Australia/Perth
2974
+ 61851226|Australia/Perth
2975
+ 61851227|Australia/Adelaide&Australia/Perth
2976
+ 61851228|Australia/Adelaide&Australia/Perth
2977
+ 61851229|Australia/Adelaide&Australia/Perth
2978
+ 61851230|Australia/Sydney
2979
+ 61851231|Australia/Adelaide&Australia/Perth
2980
+ 61851232|Australia/Sydney
2981
+ 61851233|Australia/Sydney
2982
+ 61851234|Australia/Sydney
2983
+ 61851235|Indian/Christmas
2984
+ 61851236|Australia/Adelaide&Australia/Perth
2985
+ 61851237|Australia/Adelaide&Australia/Perth
2986
+ 61851238|Australia/Adelaide&Australia/Perth
2987
+ 61851239|Australia/Adelaide&Australia/Perth
2988
+ 6185124|Australia/Sydney
2989
+ 6185125|Australia/Sydney
2990
+ 6185126|Australia/Sydney
2991
+ 6185127|Australia/Adelaide&Australia/Perth
2992
+ 6185128|Australia/Adelaide&Australia/Perth
2993
+ 6185129|Australia/Adelaide&Australia/Perth
2905
2994
  6186|Australia/Adelaide&Australia/Perth
2906
2995
  6187|Australia/Adelaide&Australia/Perth
2907
2996
  6188|Australia/Adelaide&Australia/Perth
@@ -2942,11 +3031,15 @@
2942
3031
  61891700|Australia/Adelaide&Australia/Perth&Indian/Christmas
2943
3032
  61891701|Australia/Adelaide&Australia/Perth&Indian/Christmas
2944
3033
  61891702|Australia/Adelaide&Australia/Perth&Indian/Cocos
3034
+ 61891703|Indian/Cocos
2945
3035
  61891710|Australia/Adelaide&Australia/Perth&Indian/Christmas
2946
3036
  61891711|Australia/Adelaide&Australia/Perth&Indian/Christmas
2947
3037
  61891712|Australia/Adelaide&Australia/Perth&Indian/Christmas
3038
+ 61891958|Indian/Christmas
2948
3039
  61891959|Australia/Adelaide&Australia/Perth&Indian/Cocos
2949
3040
  62|Asia/Jakarta&Asia/Jayapura&Asia/Makassar
3041
+ 62007|Asia/Jakarta&Asia/Makassar
3042
+ 621|Asia/Jakarta&Asia/Makassar
2950
3043
  622|Asia/Jakarta
2951
3044
  6231|Asia/Jakarta
2952
3045
  6232|Asia/Jakarta
@@ -2954,12 +3047,8 @@
2954
3047
  6234|Asia/Jakarta
2955
3048
  6235|Asia/Jakarta
2956
3049
  6236|Asia/Makassar
2957
- 62370|Asia/Makassar
2958
- 62371|Asia/Makassar
2959
- 62372|Asia/Makassar
2960
- 62373|Asia/Makassar
2961
- 62374|Asia/Makassar
2962
- 62376|Asia/Makassar
3050
+ 6237|Asia/Makassar
3051
+ 62379|Asia/Jakarta&Asia/Makassar
2963
3052
  6238|Asia/Makassar
2964
3053
  624|Asia/Makassar
2965
3054
  62403|Asia/Jayapura&Asia/Makassar
@@ -2984,27 +3073,21 @@
2984
3073
  6256|Asia/Jakarta
2985
3074
  626|Asia/Jakarta
2986
3075
  627|Asia/Jakarta
2987
- 6281|Asia/Jakarta
3076
+ 628|Asia/Jakarta
3077
+ 6280|Asia/Jakarta&Asia/Makassar
2988
3078
  62811|Asia/Jakarta&Asia/Makassar
2989
3079
  62818|Asia/Jakarta&Asia/Makassar
2990
3080
  62819|Asia/Jakarta&Asia/Makassar
2991
- 6282|Asia/Jakarta
2992
3081
  62824|Asia/Jakarta&Asia/Makassar
2993
3082
  62829|Asia/Jakarta&Asia/Makassar
2994
- 6283|Asia/Jakarta
2995
3083
  62831|Asia/Jakarta&Asia/Makassar
2996
3084
  62833|Asia/Jakarta&Asia/Makassar
2997
3085
  62834|Asia/Jakarta&Asia/Makassar
2998
3086
  62839|Asia/Jakarta&Asia/Makassar
2999
- 6285|Asia/Jakarta
3000
3087
  62853|Asia/Jakarta&Asia/Makassar
3001
- 6286|Asia/Jakarta
3002
3088
  62868|Asia/Jakarta&Asia/Makassar
3003
- 6287|Asia/Jakarta
3004
3089
  62876|Asia/Jakarta&Asia/Makassar
3005
- 6288|Asia/Jakarta
3006
3090
  62887|Asia/Jakarta&Asia/Makassar
3007
- 6289|Asia/Jakarta
3008
3091
  6290|Asia/Jayapura
3009
3092
  6291|Asia/Jayapura
3010
3093
  62915|Asia/Jakarta&Asia/Jayapura
@@ -3027,11 +3110,16 @@
3027
3110
  6298|Asia/Jayapura
3028
3111
  63|Asia/Manila
3029
3112
  64|Pacific/Auckland&Pacific/Chatham
3113
+ 641|Pacific/Auckland
3114
+ 642|Pacific/Auckland
3030
3115
  643|Pacific/Auckland
3031
- 643305|Pacific/Chatham
3116
+ 64330|Pacific/Chatham
3032
3117
  644|Pacific/Auckland
3118
+ 645|Pacific/Auckland
3033
3119
  646|Pacific/Auckland
3034
3120
  647|Pacific/Auckland
3121
+ 6480|Pacific/Auckland
3122
+ 6486|Pacific/Auckland
3035
3123
  649|Pacific/Auckland
3036
3124
  65|Asia/Singapore
3037
3125
  66|Asia/Bangkok
@@ -3054,15 +3142,17 @@
3054
3142
  688|Pacific/Funafuti
3055
3143
  689|Pacific/Gambier&Pacific/Marquesas&Pacific/Tahiti
3056
3144
  6894|Pacific/Tahiti
3145
+ 68980|Pacific/Gambier&Pacific/Marquesas&Pacific/Tahiti
3057
3146
  68987|Pacific/Gambier&Pacific/Marquesas&Pacific/Tahiti
3058
3147
  68988|Pacific/Tahiti
3059
3148
  68989|Pacific/Tahiti
3060
3149
  690|Pacific/Fakaofo
3061
3150
  691|Pacific/Kosrae&Pacific/Ponape&Pacific/Truk
3151
+ 6913|Pacific/Truk
3062
3152
  69132|Pacific/Ponape
3063
- 69133|Pacific/Truk
3064
- 69135|Pacific/Truk
3065
3153
  69137|Pacific/Kosrae
3154
+ 6918|Pacific/Kosrae&Pacific/Ponape&Pacific/Truk
3155
+ 6919|Pacific/Kosrae&Pacific/Ponape&Pacific/Truk
3066
3156
  691920|Pacific/Ponape
3067
3157
  691921|Pacific/Ponape
3068
3158
  691924|Pacific/Ponape
@@ -3100,12 +3190,18 @@
3100
3190
  747|Europe/Moscow
3101
3191
  748|Europe/Moscow
3102
3192
  749|Europe/Moscow
3193
+ 77|Asia/Almaty&Asia/Aqtobe
3103
3194
  771|Asia/Almaty
3104
3195
  7711|Asia/Aqtobe
3105
3196
  7712|Asia/Aqtobe
3106
3197
  7713|Asia/Aqtobe
3107
3198
  772|Asia/Almaty
3108
3199
  7729|Asia/Aqtobe
3200
+ 7800|Asia/Almaty&Asia/Aqtobe&Europe/Moscow
3201
+ 7803|Europe/Moscow
3202
+ 7804|Europe/Moscow
3203
+ 7808|Asia/Almaty&Asia/Aqtobe&Europe/Moscow
3204
+ 7809|Asia/Almaty&Asia/Aqtobe&Europe/Moscow
3109
3205
  781|Europe/Moscow
3110
3206
  782|Europe/Moscow
3111
3207
  783|Europe/Moscow
@@ -3122,6 +3218,7 @@
3122
3218
  7855|Europe/Moscow
3123
3219
  786|Europe/Moscow
3124
3220
  787|Europe/Moscow
3221
+ 79|Europe/Moscow
3125
3222
  81|Asia/Tokyo
3126
3223
  82|Asia/Seoul
3127
3224
  84|Asia/Bangkok
@@ -3178,18 +3275,6 @@
3178
3275
  97624|Asia/Hovd
3179
3276
  97625|Asia/Ulaanbaatar
3180
3277
  976258|Asia/Choibalsan
3181
- 9765000|Asia/Ulaanbaatar
3182
- 9765001|Asia/Ulaanbaatar
3183
- 9765002|Asia/Ulaanbaatar
3184
- 9765006|Asia/Ulaanbaatar
3185
- 9765011|Asia/Ulaanbaatar
3186
- 9765037|Asia/Ulaanbaatar
3187
- 9765050|Asia/Ulaanbaatar
3188
- 9765088|Asia/Ulaanbaatar
3189
- 9765099|Asia/Ulaanbaatar
3190
- 9765515|Asia/Ulaanbaatar
3191
- 9765525|Asia/Ulaanbaatar
3192
- 9765526|Asia/Ulaanbaatar
3193
3278
  977|Asia/Katmandu
3194
3279
  98|Asia/Tehran
3195
3280
  992|Asia/Dushanbe
@@ -8,7 +8,7 @@ module TelephoneNumber
8
8
  master_data = {}
9
9
  bin_file_path = "#{File.dirname(file_path)}/#{File.basename(file_path, '.txt')}.dat"
10
10
 
11
- File.open(file_path, 'r').each do |row|
11
+ File.open(file_path, 'r:UTF-8').each do |row|
12
12
  next if row.strip !~ /^[0-9]/
13
13
  number, location = row.split('|')
14
14
  master_data[number.strip] = location.strip
@@ -1,5 +1,4 @@
1
1
  require 'telephone_number/version'
2
- require 'utilities/hash'
3
2
  require 'active_model/telephone_number_validator' if defined?(ActiveModel)
4
3
  require 'forwardable'
5
4
 
@@ -7,18 +7,18 @@ module TelephoneNumber
7
7
  MOBILE_TOKEN_COUNTRIES = { AR: '9' }.freeze
8
8
 
9
9
  def initialize(data_hash)
10
+ validations = data_hash.fetch(:validations, {}).dup
10
11
  @country_code = data_hash[:country_code]
11
12
  @country_id = data_hash[:id]
12
- @general_validation = NumberValidation.new(:general_desc, data_hash[:validations][:general_desc]) if data_hash.fetch(:validations, {})[:general_desc]
13
+ @general_validation = NumberValidation.new(:general_desc, validations[:general_desc]) if validations[:general_desc]
13
14
  @international_prefix = Regexp.new(data_hash[:international_prefix]) if data_hash[:international_prefix]
14
15
  @main_country_for_code = data_hash[:main_country_for_code] == 'true'
15
16
  @mobile_token = MOBILE_TOKEN_COUNTRIES[@country_id.to_sym]
16
17
  @national_prefix = data_hash[:national_prefix]
17
18
  @national_prefix_for_parsing = Regexp.new(data_hash[:national_prefix_for_parsing]) if data_hash[:national_prefix_for_parsing]
18
19
  @national_prefix_transform_rule = data_hash[:national_prefix_transform_rule]
19
- @validations = data_hash.fetch(:validations, {})
20
- .except(:general_desc, :area_code_optional)
21
- .map { |name, data| NumberValidation.new(name, data) }
20
+ @validations = validations.delete_if { |name, _| name == :general_desc || name == :area_code_optional }
21
+ .map { |name, data| NumberValidation.new(name, data) }
22
22
  @formats = data_hash.fetch(:formats, []).map { |format| NumberFormat.new(format, data_hash[:national_prefix_formatting_rule]) }
23
23
  end
24
24
 
@@ -52,11 +52,24 @@ module TelephoneNumber
52
52
  end
53
53
 
54
54
  def self.load_data
55
- data_file = "#{File.dirname(__FILE__)}/../../data/telephone_number_data_file.dat"
56
- main_data = Marshal.load(File.binread(data_file))
57
- override_data = {}
58
- override_data = Marshal.load(File.binread(TelephoneNumber.override_file)) if TelephoneNumber.override_file
59
- return main_data.deep_deep_merge!(override_data)
55
+ data_path = "#{File.dirname(__FILE__)}/../../data/telephone_number_data_file.dat"
56
+ main_data = Marshal.load(File.binread(data_path))
57
+ if TelephoneNumber.override_file
58
+ override_data = Marshal.load(File.binread(TelephoneNumber.override_file))
59
+ main_data = deep_merge(main_data, override_data)
60
+ end
61
+ main_data
62
+ end
63
+
64
+ def self.deep_merge(base_hash, other_hash)
65
+ other_hash.each do |key, value|
66
+ base_hash[key] = if base_hash[key].is_a?(Hash) && value.is_a?(Hash)
67
+ deep_merge(base_hash[key], value)
68
+ else
69
+ value
70
+ end
71
+ end
72
+ base_hash
60
73
  end
61
74
 
62
75
  def self.all_countries