phonelib 0.6.56 → 0.6.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/phone_data.dat +0 -0
- data/lib/phonelib/data_importer.rb +50 -0
- data/lib/phonelib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18f3a063d8059ddaaadcdf93350da7722596deb8eceedc3fff2582a92cbb51b
|
4
|
+
data.tar.gz: 0a00eff81cad4d498ddc60a3080813ea9df7d7f6089fd9eba0ba50b8419e0b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c54689fada25b70ecf4a8c2dafd0cca72f74d4b7909103c12b6fe02590095a40ce4051fb54eff06eaf198ca66a0b64e3f65e68e25907e872cd7c0cc530c6f12
|
7
|
+
data.tar.gz: 6313294668d0cb684aaa312cd350f3ac4b4f791a1ceb1ebfd19c0cd3c7815cc4a15b09711c05cf7ad7d0fd775691f0f1ea4f7680cf5c42c99014f41e45aa5fae
|
data/data/phone_data.dat
CHANGED
Binary file
|
@@ -19,6 +19,47 @@ module Phonelib
|
|
19
19
|
|
20
20
|
# countries that can have double country prefix in number
|
21
21
|
DOUBLE_COUNTRY_CODES_COUNTRIES = %w(IN DE BR IT NO PL CU VN)
|
22
|
+
FORMAT_SHARING = {
|
23
|
+
'CA' => 'US',
|
24
|
+
'CC' => 'AU',
|
25
|
+
'CX' => 'AU',
|
26
|
+
'DM' => 'US',
|
27
|
+
'DO' => 'US',
|
28
|
+
'EH' => 'MA',
|
29
|
+
'GD' => 'US',
|
30
|
+
'GG' => 'GB',
|
31
|
+
'GU' => 'US',
|
32
|
+
'IM' => 'GB',
|
33
|
+
'JE' => 'GB',
|
34
|
+
'JM' => 'US',
|
35
|
+
'KN' => 'US',
|
36
|
+
'KY' => 'US',
|
37
|
+
'KZ' => 'RU',
|
38
|
+
'LC' => 'US',
|
39
|
+
'MF' => 'GP',
|
40
|
+
'MP' => 'US',
|
41
|
+
'MS' => 'US',
|
42
|
+
'PR' => 'US',
|
43
|
+
'SJ' => 'NO',
|
44
|
+
'SX' => 'US',
|
45
|
+
'TA' => 'SH',
|
46
|
+
'TC' => 'US',
|
47
|
+
'TT' => 'US',
|
48
|
+
'VA' => 'IT',
|
49
|
+
'VC' => 'US',
|
50
|
+
'VG' => 'US',
|
51
|
+
'VI' => 'US',
|
52
|
+
'YT' => 'RE',
|
53
|
+
'AG' => 'US',
|
54
|
+
'AI' => 'US',
|
55
|
+
'AS' => 'US',
|
56
|
+
'AX' => 'FI',
|
57
|
+
'BB' => 'US',
|
58
|
+
'BL' => 'GP',
|
59
|
+
'BM' => 'US',
|
60
|
+
'BQ' => 'CW',
|
61
|
+
'BS' => 'US',
|
62
|
+
}
|
22
63
|
|
23
64
|
# main data file in repo
|
24
65
|
MAIN_FILE = 'resources/PhoneNumberMetadata.xml'
|
@@ -55,6 +96,7 @@ module Phonelib
|
|
55
96
|
import_main_data
|
56
97
|
import_short_data
|
57
98
|
import_alternate_formats
|
99
|
+
process_format_links
|
58
100
|
import_geocoding_data
|
59
101
|
import_timezone_data
|
60
102
|
import_carrier_data
|
@@ -115,6 +157,14 @@ module Phonelib
|
|
115
157
|
end
|
116
158
|
end
|
117
159
|
|
160
|
+
# some countries missing formats, and are linking them to another countries
|
161
|
+
def process_format_links
|
162
|
+
FORMAT_SHARING.each do |destination, source|
|
163
|
+
@data[destination][:formats] ||= []
|
164
|
+
@data[destination][:formats] = @data[destination][:formats] + @data[source][:formats]
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
118
168
|
# method parses geocoding data dir
|
119
169
|
def import_geocoding_data
|
120
170
|
puts 'IMPORTING GEOCODING DATA'
|
data/lib/phonelib/version.rb
CHANGED