phony 2.15.33 → 2.15.34
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/brazil.rb +3 -3
- data/spec/lib/phony/countries_spec.rb +6 -1
- 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: 2cfea1b2c896c11f99eaf4d577489d7b78bc80e2
|
4
|
+
data.tar.gz: c48fb044665be985ee8780bc427e0f6eb36c7b26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7450503afab6cf778a54a50d229860905ac4763a5376a52e6540016ce75301d129986ef6820adef35123d4319a3a7423aa34fce6ba74c348e2c9c34c25206c7
|
7
|
+
data.tar.gz: df109cf1ea2f6cd083aa589a8ae8ffe2362968af67583a93c06e842bc7d4f668e3a53227a342e3b532edfc173e3768a28eb55201bce2372396d2514907124e5f
|
@@ -87,7 +87,7 @@
|
|
87
87
|
# 98 #Maranhão
|
88
88
|
# 99 #Maranhão
|
89
89
|
|
90
|
-
ndcs =
|
90
|
+
ndcs = "(11|12|13|14|15|16|17|18|19|21|22|24|27|28|31|32|33|34|35|36|37|38|41|42|43|44|45|46|47|48|49|51|52|53|54|55|61|62|63|64|65|66|67|68|69|71|72|73|74|75|77|78|79|81|82|83|84|85|86|87|88|89|91|92|93|94|95|96|97|98|99)"
|
91
91
|
|
92
92
|
service = %w{ 100 128 190 191 192 193 194 197 198 199 } # State specific numbers were not added. See http://www.brasil.gov.br/navegue_por/aplicativos/agenda
|
93
93
|
|
@@ -96,8 +96,8 @@ special_numbers_4 = %w{ 3003 4003 4004 4020 }
|
|
96
96
|
|
97
97
|
Phony.define do
|
98
98
|
country '55',
|
99
|
-
match(
|
100
|
-
match(ndcs)
|
99
|
+
match(/^#{ndcs}9\d{8}$/) >> split(5,4) |
|
100
|
+
match(/^#{ndcs}\d{8}$/) >> split(4,4) |
|
101
101
|
one_of(special_numbers_3_4) >> split(3,4) |
|
102
102
|
one_of(special_numbers_4) >> split(4) |
|
103
103
|
one_of(service) >> split(3) |
|
@@ -142,8 +142,10 @@ describe 'country descriptions' do
|
|
142
142
|
it_splits '5531991311234', ['55', '31', '99131', '1234'] # Belo Horizonte's 9th digit
|
143
143
|
it_splits '5571991311234', ['55', '71', '99131', '1234'] # Salvador's 9th digit
|
144
144
|
it_splits '5579991311234', ['55', '79', '99131', '1234'] # Sergipe's 9th digit
|
145
|
+
it_splits '5547991311234', ['55', '47', '99131', '1234'] # Santa Catarina's 9th digit
|
146
|
+
it_splits '5541991311234', ['55', '41', '99131', '1234'] # Parana's 9th digit
|
145
147
|
|
146
|
-
context '
|
148
|
+
context 'mobile numbers' do
|
147
149
|
%w{
|
148
150
|
11 12 13 14 15 16 17 18 19
|
149
151
|
21 22 24 27 28
|
@@ -152,6 +154,9 @@ describe 'country descriptions' do
|
|
152
154
|
71 73 74 75 77 79
|
153
155
|
81 82 83 84 85 86 87 88 89
|
154
156
|
91 92 93 94 95 96 97 98 99
|
157
|
+
41 42 43 44 45 46
|
158
|
+
47 48 49
|
159
|
+
51 53 54 55
|
155
160
|
}.each do |state_code|
|
156
161
|
it_splits "55#{state_code}993051123", ['55', state_code, '99305', '1123']
|
157
162
|
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.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-11 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
|