phony_rails 0.12.2 → 0.12.3

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: 69276a65ab509580ebd6b96adb01c6ae03ff2bf8
4
- data.tar.gz: 3faddbca4183fee934927c93787223f8a46b4c00
3
+ metadata.gz: 2355478441210acbafebb74435193835a27a3b6f
4
+ data.tar.gz: ad9a7043b6fdda221b8283ed9f1f6ac359f6ac52
5
5
  SHA512:
6
- metadata.gz: 852574f157477ddf3d38658f778f394e423db680ba326cd182ac691619eabf652aeee20612f51744d971bdfecd0e880edfa338928c0750c5b6cba10bf42867bb
7
- data.tar.gz: 58d821718858e450291e23a006099630eb259284186e2aeb3c60fdc717cb12f406f2ba535b71de7c432d8bacc60be3a5944b7b81e79ee2792672cc10d320d8fd
6
+ metadata.gz: be3de636fac977f1b2f0cb1f9c3179aa9a076609b523e8a8e4bf43550057d9edb4d4651d2c03fe9fdcec479730bafc54b2d766b10465060950b129ee4f26b526
7
+ data.tar.gz: aacfe26b61f9a7b87c31ff7d0f7eded00c0fffa5bad37bd04f3e80b3cade8cfbf2335ff1a6d60d06050c3a5c140471df3a6203b2008af1bf196d510ac84c2cb7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- phony_rails (0.12.1)
4
+ phony_rails (0.12.3)
5
5
  activesupport (>= 3.0)
6
6
  countries (~> 0.8, >= 0.8.2)
7
7
  phony (~> 2.12)
@@ -35,8 +35,10 @@ module PhonyRails
35
35
  options[:add_plus] = true if options[:add_plus].nil?
36
36
  # We try to add the default country number and see if it is a
37
37
  # correct phone number. See https://github.com/joost/phony_rails/issues/87#issuecomment-89324426
38
- if Phony.plausible?("#{_default_country_number}#{number}") || !Phony.plausible?(number) || country_code_from_number(number).nil?
39
- number = "#{_default_country_number}#{number}"
38
+ if not (number =~ /\A\+/) # if we don't have a +
39
+ if Phony.plausible?("#{_default_country_number}#{number}") || !Phony.plausible?(number) || country_code_from_number(number).nil?
40
+ number = "#{_default_country_number}#{number}"
41
+ end
40
42
  end
41
43
  # number = "#{_default_country_number}#{number}" unless Phony.plausible?(number)
42
44
  end
@@ -1,3 +1,3 @@
1
1
  module PhonyRails
2
- VERSION = "0.12.2"
2
+ VERSION = "0.12.3"
3
3
  end
@@ -106,6 +106,7 @@ describe PhonyRails do
106
106
  it "should pass Github issue #87" do
107
107
  PhonyRails.normalize_number('2318725305', country_code: 'US').should eq('+12318725305')
108
108
  PhonyRails.normalize_number('2318725305', default_country_code: 'US').should eq('+12318725305')
109
+ PhonyRails.normalize_number('+2318725305', default_country_code: 'US').should eq('+2318725305')
109
110
  end
110
111
  end
111
112
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.2
4
+ version: 0.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joost Hietbrink