phony 2.15.4 → 2.15.5
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/lib/phony/countries/brazil.rb +1 -1
- data/spec/lib/phony/countries_spec.rb +5 -3
- 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: fb98a6f1e6d86a1a392813411b2ca9c44c843c8b
|
|
4
|
+
data.tar.gz: 636250aa357af2170d0372cd3a44c0781b2bd18d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc64c2d3c67016eb8f64c5d2914c0ef47a1447a740f0ebaf2d7ade08ef2649c5b5732845ae728137bcc857a6249c39602e8437d711a99ce20ff59894e0307ec9
|
|
7
|
+
data.tar.gz: 27dcdbf81c7690cb8964b69f1a3bb551b7078236170942a1c2dde6b179274990d8853a4612ea9ecf791a7e63eabe8e89fab27079a95e80b2a78a552005cfe718
|
|
@@ -96,7 +96,7 @@ special_numbers_4 = %w{ 3003 4004 4020 }
|
|
|
96
96
|
|
|
97
97
|
Phony.define do
|
|
98
98
|
country '55',
|
|
99
|
-
match(/^(11|12|13|14|15|16|17|18|19|21|22|24|27|28|81|82|83|84|85|86|87|88|89|91|92|93|94|95|96|97|98|99)9\d{8}$/) >> split(5,4) |
|
|
99
|
+
match(/^(11|12|13|14|15|16|17|18|19|21|22|24|27|28|31|32|33|34|35|37|38|71|73|74|75|77|79|81|82|83|84|85|86|87|88|89|91|92|93|94|95|96|97|98|99)9\d{8}$/) >> split(5,4) |
|
|
100
100
|
match(ndcs) >> split(4,4) |
|
|
101
101
|
one_of(special_numbers_3_4) >> split(3,4) |
|
|
102
102
|
one_of(special_numbers_4) >> split(4) |
|
|
@@ -121,11 +121,13 @@ describe 'country descriptions' do
|
|
|
121
121
|
it_splits '5511981231234', ['55', '11', '98123', '1234'] # São Paulo's 9 digits mobile
|
|
122
122
|
it_splits '552181231234', ['55', '21', '8123', '1234']
|
|
123
123
|
it_splits '5521981231234', ['55', '21', '98123', '1234'] # Rio de Janeiro's 9 digits mobile
|
|
124
|
-
it_splits '551931311234', ['55', '19', '3131', '1234']
|
|
125
|
-
it_splits '
|
|
124
|
+
it_splits '551931311234', ['55', '19', '3131', '1234']
|
|
125
|
+
it_splits '5531991311234', ['55', '31', '99131', '1234'] # Belo Horizonte's 9th digit
|
|
126
|
+
it_splits '5571991311234', ['55', '71', '99131', '1234'] # Salvador's 9th digit
|
|
127
|
+
it_splits '5579991311234', ['55', '79', '99131', '1234'] # Sergipe's 9th digit
|
|
126
128
|
|
|
127
129
|
context "special states with 9 in mobile" do
|
|
128
|
-
%w{ 11 12 13 14 15 16 17 18 19 21 22 24 27 28 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99}.each do |state_code|
|
|
130
|
+
%w{ 11 12 13 14 15 16 17 18 19 21 22 24 27 28 31 32 33 34 35 37 38 71 73 74 75 77 79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99}.each do |state_code|
|
|
129
131
|
it_splits "55#{state_code}993051123", ['55', state_code, '99305', '1123']
|
|
130
132
|
end
|
|
131
133
|
end
|
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.15.
|
|
4
|
+
version: 2.15.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Hanke
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-21 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
|