phonelib 0.6.55 → 0.6.58

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: ecdda9f8093d20e648458be7dcd8f53d3ff55f47250a69af51cd4414d3792842
4
- data.tar.gz: e7cdff4ba507a3b9a1e4919fc67154777f55b76a02096791932d92488c3382be
3
+ metadata.gz: 1cfc6e3a60c622177adbc8caf40673faebc7a4919c766d021a199ec52372a385
4
+ data.tar.gz: 759d7b9dfa7807dcf33a3b19fc6e3a8d5cb98febe1f9458dced2f7d8a96a40f6
5
5
  SHA512:
6
- metadata.gz: bfc44e2043ea2115ee1852a5bf2e21e07fe9bd27d0501a6c44451ff4e5d22150580cdf196c5886e1867610be4424fe17ae5e09754ce516a8541e7bc8080e2b54
7
- data.tar.gz: eb7da4439a2d40378b6f38d6d386cc7b55ecc2fd7400f368ccac40c6770ed5142d510c243e1d2a9687519dd0261265dafa6960221ed2e4881f5bbeb92d338c9f
6
+ metadata.gz: a56a4ad205176638db2a08bb79c8366df4a0d839f971e7b8b38162c2089ad98671602e6a4f128510de78cf4e9fc73762af60e940fe7dcd8b8b9bd00d52f2186e
7
+ data.tar.gz: b5be23901e6786c28dfa16cd83130256e88a2323dacc7f9b45c5f6baa342b9a379076af3d1a4629b1b4a33b63c5ae11dd91943374b5daa67f85c20ed40704dd7
data/README.md CHANGED
@@ -252,7 +252,7 @@ phone.full_e164 # returns e164 phone representation with extension
252
252
  phone.full_international # returns formatted international number with extension
253
253
  ```
254
254
 
255
- You can pass <tt>false</tt> to <tt>national</tt> and <tt>international</tt> methods in order to get unformatted representaions
255
+ You can pass <tt>false</tt> to <tt>national</tt> and <tt>international</tt> methods in order to get unformatted representations
256
256
 
257
257
  ``` ruby
258
258
  phone.international(false) # returns unformatted international phone
Binary file
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.55'
3
+ VERSION = '0.6.58'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.55
4
+ version: 0.6.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Senderovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake