phonelib 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/extended_data.dat +0 -0
- data/data/phone_data.dat +0 -0
- data/lib/phonelib/data_importer.rb +2 -2
- data/lib/phonelib/phone_analyzer.rb +5 -1
- data/lib/phonelib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e14bd0d38f0006d075d1d7d57c3532826a6cd28797b6b646643cac493d8ec820
|
4
|
+
data.tar.gz: 5d152596149d3c0a8953408917255fc91e1ae8f3ff44a6cf478544f5f75a6619
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2893fd50a54de66f7be75ecd69eeae41899f25a59287bec615a8bd5f362822a014ff05ed79787f49961024758ee10fc9e7ea1d275e8df3a96ef68b12c33cad64
|
7
|
+
data.tar.gz: 9a63ff6d268ef3f986586068ea89c4af549924873c7e230206f1e46a5f66780cb95b96b2627b22b0312580d2d2f52d4c03256d4d9422713f1b380258ac2f7dbb
|
data/data/extended_data.dat
CHANGED
Binary file
|
data/data/phone_data.dat
CHANGED
Binary file
|
@@ -8,7 +8,7 @@ module Phonelib
|
|
8
8
|
require 'nokogiri'
|
9
9
|
|
10
10
|
# official libphonenumber repo for cloning
|
11
|
-
REPO = 'https://github.com/
|
11
|
+
REPO = 'https://github.com/google/libphonenumber.git'
|
12
12
|
|
13
13
|
# importing function
|
14
14
|
def self.import
|
@@ -203,7 +203,7 @@ module Phonelib
|
|
203
203
|
require 'open-uri'
|
204
204
|
require 'csv'
|
205
205
|
io = URI.open('http://download.geonames.org/export/dump/countryInfo.txt')
|
206
|
-
csv = CSV.new(io, {col_sep: "\t"})
|
206
|
+
csv = CSV.new(io, **{col_sep: "\t"})
|
207
207
|
csv.each do |row|
|
208
208
|
next if row[0].nil? || row[0].start_with?('#') || row[0].empty? || row[0].size != 2
|
209
209
|
|
@@ -174,7 +174,11 @@ module Phonelib
|
|
174
174
|
# * +not_valid+ - specifies that number is not valid by general desc pattern
|
175
175
|
def national_and_data(data, country_match, not_valid = false)
|
176
176
|
result = data.select { |k, _v| k != :types && k != :formats }
|
177
|
-
|
177
|
+
index = 0
|
178
|
+
if Phonelib.additional_regexes.is_a?(Hash) && Phonelib.additional_regexes[data[:id]]
|
179
|
+
index = Phonelib.additional_regexes[data[:id]].values.flatten.join('|').scan(/\(/).size
|
180
|
+
end
|
181
|
+
phone = country_match.to_a[-1 - index]
|
178
182
|
result[:national] = phone
|
179
183
|
result[:format] = number_format(phone, data[Core::FORMATS])
|
180
184
|
result.merge! all_number_types(phone, data[Core::TYPES], not_valid)
|
data/lib/phonelib/version.rb
CHANGED
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.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vadim Senderovich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Google libphonenumber library was taken as a basis for
|
@@ -40,7 +40,7 @@ homepage: https://github.com/daddyz/phonelib
|
|
40
40
|
licenses:
|
41
41
|
- MIT
|
42
42
|
metadata:
|
43
|
-
changelog_uri: https://github.com/daddyz/phonelib/releases/tag/v0.10.
|
43
|
+
changelog_uri: https://github.com/daddyz/phonelib/releases/tag/v0.10.2
|
44
44
|
post_install_message:
|
45
45
|
rdoc_options:
|
46
46
|
- " --no-private - CHANGELOG.md --readme README.md"
|