phony_rails 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- phony_rails (0.3.0)
4
+ phony_rails (0.3.2)
5
5
  activerecord (>= 3.0)
6
6
  countries (>= 0.8.2)
7
7
  phony (>= 1.7.7)
@@ -8,7 +8,7 @@
8
8
  # "010-12341234".phony_formatted(:normalize => :NL)
9
9
  def phony_formatted(options = {})
10
10
  normalize_country_code = options.delete(:normalize)
11
- s = (normalize_country_code ? PhonyRails.normalize_number(self, :country_code => normalize_country_code.to_s) : self.gsub(/\D/, ''))
11
+ s = (normalize_country_code ? PhonyRails.normalize_number(self, :default_country_code => normalize_country_code.to_s) : self.gsub(/\D/, ''))
12
12
  return if s.blank?
13
13
  Phony.formatted(s, options.reverse_merge(:format => :national))
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module PhonyRails
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -42,6 +42,10 @@ describe PhonyRails do
42
42
  "+31-10-1234123".phony_formatted(:normalize => :NL, :format => :international, :spaces => '-').should eql('+31-10-1234123')
43
43
  end
44
44
 
45
+ it "should phony_format String with country code different than normalized value" do
46
+ "+4790909090".phony_formatted(:normalize => :SE, :format => :international).should eql('+47 909 09 090')
47
+ end
48
+
45
49
  end
46
50
 
47
51
  it "should not change original String" do
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.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: phony