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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc81b807a62a6de5d6b0cea3d86d92533ec36aaf489da37871d97b5078c60712
4
- data.tar.gz: 54b56a7c12f8b5d7f214443888f46a2f2c11dad4febc1b48c6650a41b9f7ce2e
3
+ metadata.gz: f18f3a063d8059ddaaadcdf93350da7722596deb8eceedc3fff2582a92cbb51b
4
+ data.tar.gz: 0a00eff81cad4d498ddc60a3080813ea9df7d7f6089fd9eba0ba50b8419e0b73
5
5
  SHA512:
6
- metadata.gz: 153cfac4ad2408f8310f348335dea21f806915f4c99cd4601d00782cbba765d538a71c6da1b825682fe1143d6888f30b8897a2d7a2b4e51e574e0bfd348343ef
7
- data.tar.gz: bfe3dd06f91091344f5dde61479d87fea0d28aad89aff687284aa87730eca2b3ab83b803b978a756ab517c4066b0b59c98150c1cfa74d9e92b87e88b9f0d649a
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'
@@ -1,4 +1,4 @@
1
1
  module Phonelib
2
2
  # @private
3
- VERSION = '0.6.56'
3
+ VERSION = '0.6.57'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.56
4
+ version: 0.6.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Senderovich