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.
- data/Gemfile.lock +1 -1
- data/lib/phony_rails/string_extensions.rb +1 -1
- data/lib/phony_rails/version.rb +1 -1
- data/spec/lib/phony_rails_spec.rb +4 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -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, :
|
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
|
data/lib/phony_rails/version.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2013-05-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: phony
|