phony_rails 0.12.3 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/phony_rails.rb +1 -1
- data/lib/phony_rails/version.rb +1 -1
- data/lib/validators/phony_validator.rb +1 -0
- data/spec/lib/phony_rails_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 580be97d53e4e08977013b8033af91d391dea1b2
|
4
|
+
data.tar.gz: 86fbc558bf484ab8f60a63eaa197d9dbdea887d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80b6bfc73635665590541c82cf4653016cc7b853faea145889be9008ec74aa2e522ac5f2bf9e2aea29015801666f1c09f0d986dcc01490b7975dba30ee6a2df2
|
7
|
+
data.tar.gz: 7312b87a901d27a09e923e02a916277f1da3af13e180bc08a701a6480521141f1331067ec92e8f16db449739046676c6202d77610b448510969f85c080a18b40
|
data/Gemfile.lock
CHANGED
data/lib/phony_rails.rb
CHANGED
@@ -22,7 +22,7 @@ module PhonyRails
|
|
22
22
|
def self.normalize_number(number, options = {})
|
23
23
|
return if number.nil?
|
24
24
|
number = number.clone # Just to be sure, we don't want to change the original.
|
25
|
-
number.gsub!(/[^\d\+]/, '') # Strips weird stuff from the number
|
25
|
+
number.gsub!(/[^\(\)\d\+]/, '') # Strips weird stuff from the number
|
26
26
|
return if number.blank?
|
27
27
|
if _country_number = options[:country_number] || country_number_for(options[:country_code])
|
28
28
|
options[:add_plus] = true if options[:add_plus].nil?
|
data/lib/phony_rails/version.rb
CHANGED
@@ -108,6 +108,12 @@ describe PhonyRails do
|
|
108
108
|
PhonyRails.normalize_number('2318725305', default_country_code: 'US').should eq('+12318725305')
|
109
109
|
PhonyRails.normalize_number('+2318725305', default_country_code: 'US').should eq('+2318725305')
|
110
110
|
end
|
111
|
+
|
112
|
+
it "should pass Github issue #89" do
|
113
|
+
number = '+33 (0)6 87 36 18 75'
|
114
|
+
Phony.plausible?(number).should be_true
|
115
|
+
PhonyRails.normalize_number(number, country_code: 'FR').should eq('+33687361875')
|
116
|
+
end
|
111
117
|
end
|
112
118
|
|
113
119
|
it "should not change original String" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Hietbrink
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phony
|