phony 2.18.8 → 2.18.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phony/countries.rb +2 -1
- data/spec/lib/phony/country_spec.rb +9 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 062a3448529e9cd54a3b989ab0522ee2035821af37c7b194a1b3167bdb8f1693
|
4
|
+
data.tar.gz: 6f2b104415be34d29daf0569326a5a7480c6e44f243533e5e0ed51dbe554c699
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1e05a38ac40ddf8b69792071ceaf62fe90a66f79ee0ba6992f6022a4ab88ff5d33d33fa9276612e135231f3554f01eb83f551b5c163e7e2f0faf8e0a52417d0
|
7
|
+
data.tar.gz: d2f5667fd4d32a6bd33961eca81928c2140a5383837f4a027203cad67afa34107560ea80291f35fee06fce9a43417f8e4272cc08b436eed6d5036c9f0aa18769
|
data/lib/phony/countries.rb
CHANGED
@@ -731,11 +731,12 @@ Phony.define do
|
|
731
731
|
# Monaco
|
732
732
|
#
|
733
733
|
country '377',
|
734
|
-
one_of('6')
|
734
|
+
one_of('6') >> split(2,2,2,2) | # mobile
|
735
735
|
fixed(2) >> split(2,2,2)
|
736
736
|
|
737
737
|
# San Marino
|
738
738
|
country '378',
|
739
|
+
trunk('', :normalize => false) |
|
739
740
|
none >> matched_split(
|
740
741
|
/\A\d{6}\z/ => [3,3],
|
741
742
|
/\A\d+\z/ => [3,3,4]
|
@@ -23,7 +23,7 @@ describe Phony::Country do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
context 'regression' do
|
26
|
-
describe '
|
26
|
+
describe 'Iceland' do
|
27
27
|
let(:country) do
|
28
28
|
national_splitter = Phony::NationalSplitters::None.instance_for
|
29
29
|
local_splitter = Phony::LocalSplitters::Fixed.instance_for [3, 4]
|
@@ -35,6 +35,14 @@ describe Phony::Country do
|
|
35
35
|
country.split('112').should == [nil, false, '112']
|
36
36
|
end
|
37
37
|
end
|
38
|
+
describe 'San Marino' do
|
39
|
+
it 'normalizes correctly' do
|
40
|
+
Phony.normalize('+3780549903549').should == '3780549903549'
|
41
|
+
end
|
42
|
+
xit 'automatically adds the sole NC' do
|
43
|
+
Phony.normalize('+378903549').should == '3780549903549'
|
44
|
+
end
|
45
|
+
end
|
38
46
|
end
|
39
47
|
|
40
48
|
context "without special cases (with switzerland)" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.18.
|
4
|
+
version: 2.18.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09
|
11
|
+
date: 2019-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Fast international phone number (E164 standard) normalizing, splitting
|
14
14
|
and formatting. Lots of formatting options: International (+.., 00..), national
|
@@ -114,8 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
|
-
|
118
|
-
rubygems_version: 2.7.6
|
117
|
+
rubygems_version: 3.0.3
|
119
118
|
signing_key:
|
120
119
|
specification_version: 4
|
121
120
|
summary: Fast international phone number (E164 standard) normalizing, splitting and
|