telephone_number 1.3.5 → 1.4.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6f755e7ed1429677cd62bcc91b6aea527ff0e7
|
4
|
+
data.tar.gz: 54044235d4b572d8502512d0f3f81ff57b5d56c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a421d5686401c55ca60ea98c6dcbdd97562bd871d61084ac25a7869235913db2bee176d68a85a3675418fafd8dfb5441697ef0081e48328123360198be143a9c
|
7
|
+
data.tar.gz: 30257046baba5a88b7267729bde90cda08914f8a1e81c0ede417e3e1b627041001187d289706ff103ef73cb9ba631164d0ea56bd2513fe98e8479afe4f1301e4
|
data/.travis.yml
CHANGED
@@ -79,7 +79,7 @@ module TelephoneNumber
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def underscore(camel_cased_word)
|
82
|
-
return camel_cased_word unless camel_cased_word
|
82
|
+
return camel_cased_word unless camel_cased_word.match?(/[A-Z-]|::/)
|
83
83
|
word = camel_cased_word.to_s.gsub(/::/, '/')
|
84
84
|
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
|
85
85
|
word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
|
@@ -24,7 +24,7 @@ module TelephoneNumber
|
|
24
24
|
|
25
25
|
def detect_format(number)
|
26
26
|
native_format = formats.detect do |format|
|
27
|
-
|
27
|
+
Regexp.new("^(#{format.leading_digits})").match?(number) && Regexp.new("^(#{format.pattern})$").match?(number)
|
28
28
|
end
|
29
29
|
|
30
30
|
return native_format if native_format || main_country_for_code
|
@@ -36,7 +36,7 @@ module TelephoneNumber
|
|
36
36
|
path = locale_path.empty? ? geocoding_path(:en) : locale_path
|
37
37
|
|
38
38
|
path.sort { |a, b| b <=> a }.detect do |path|
|
39
|
-
normalized_number
|
39
|
+
normalized_number.match?(/^#{File.basename(path, 'dat')}/)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -31,7 +31,7 @@ module TelephoneNumber
|
|
31
31
|
def validate
|
32
32
|
return [] unless country
|
33
33
|
country.validations.select do |validation|
|
34
|
-
normalized_number
|
34
|
+
normalized_number.match?(Regexp.new("^(#{validation.pattern})$"))
|
35
35
|
end.map(&:name)
|
36
36
|
end
|
37
37
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telephone_number
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MOBI Wireless Management
|
@@ -606,7 +606,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
606
606
|
version: '0'
|
607
607
|
requirements: []
|
608
608
|
rubyforge_project:
|
609
|
-
rubygems_version: 2.
|
609
|
+
rubygems_version: 2.6.14
|
610
610
|
signing_key:
|
611
611
|
specification_version: 4
|
612
612
|
summary: Phone number validation
|