phony 2.20.6 → 2.20.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68617b6bf80b10f9dbd64feb4f49ddab596b15b764fd61055879463dd06c5718
4
- data.tar.gz: 5baed629ebf5d0d5a41f2591b69b96b0626e43fe9a4f5f1ee1db5dc4cd16dd61
3
+ metadata.gz: a9beecb3c5ba9d3ca599f0a3284aa82305bb5512d479f0fc55c10467e1e5e3b2
4
+ data.tar.gz: b704cd453f22ebd0ca35e838895f706ee662882001c133f1f970d7b8a65338f3
5
5
  SHA512:
6
- metadata.gz: 9a91e3ec9440a6ac196dc558ec872b05f595d4b8907f50ad6ef42b23b5fb1f772aaf5a6a330e7f03e003b02df12115774d7f91eba7148e639e2d96f95816526c
7
- data.tar.gz: f7e0faa6c2372c54920dc7405e78c0635884f373775141375d8254df612026b5571a86b19011e475405260d2b498b465e6a583e6c9f0b0aeb4856c4f57af3a52
6
+ metadata.gz: c611f80164333973c6f3193f8997aaffefb492eb7417dc8a603d7adcfd5183d8c474806e1cd85e521f97078e36adecc3cbb43c50ee8062f40f994400324212aa
7
+ data.tar.gz: 2fd3068506fa93bba120e6c62eb49055bad27fee5725dc665c10112d1c8b1a1bbab148347dbda0e3d6d9e60885f4df8df56c173e56966a34544dd36cab5d5021
@@ -4,7 +4,7 @@
4
4
  #
5
5
  #
6
6
  # NDC Reference
7
- # http://www.anatel.gov.br/hotsites/CodigosNacionaisLocalidade/TelefoneCelular-CodigosDeArea.htm
7
+ # https://www.gov.br/anatel/pt-br/regulado/numeracao/plano-de-numeracao-brasileiro
8
8
 
9
9
  # 11 #Sao Paulo
10
10
  # 12 #Sao Paulo
@@ -99,7 +99,7 @@ special_numbers_4 = %w{ 3003 4003 4004 4020 }
99
99
  Phony.define do
100
100
  country '55',
101
101
  match(/^#{ndcs}9\d{8}$/) >> split(5,4) |
102
- match(/^#{ndcs}\d{8}$/) >> split(4,4) |
102
+ match(/^#{ndcs}[2-5]\d{7}$/) >> split(4,4) |
103
103
  one_of(special_numbers_3_4) >> split(3,4) |
104
104
  one_of(special_numbers_4) >> split(4) |
105
105
  one_of(service) >> split(3) |
@@ -1079,6 +1079,7 @@ Phony.define do
1079
1079
 
1080
1080
  # Lao People's Democratic Republic http://www.wtng.info/wtng-856-la.html, https://www.numberingplans.com
1081
1081
  country '856',
1082
+ trunk('0') |
1082
1083
  one_of('30') >> split(3,4) | # geographic
1083
1084
  one_of('20') >> split(4,4) | # mobile
1084
1085
  fixed(2) >> split(3,3) # geographic
@@ -51,6 +51,14 @@ describe 'plausibility' do
51
51
  it_is_correct_for 'Bosnia and Herzegovina', :samples => ['+387 66 666 666',
52
52
  '+387 37 123 456',
53
53
  '+387 33 222 111']
54
+ it 'is correct for Brasil' do
55
+ Phony.plausible?('+55 67 998280912').should be_truthy
56
+ Phony.plausible?('+55 67 98280912').should be_falsey
57
+ Phony.plausible?('+55 11 12345678').should be_falsey
58
+ Phony.plausible?('+55 11 123456789').should be_falsey
59
+ Phony.plausible?('+55 11 023456789').should be_falsey
60
+ Phony.plausible?('+55 11 22345678').should be_truthy
61
+ end
54
62
  it 'is correct for Bulgaria' do
55
63
  Phony.plausible?('+359 2 1234567').should be_truthy
56
64
  Phony.plausible?('+359 30 12345').should be_truthy
@@ -147,9 +147,8 @@ describe 'country descriptions' do
147
147
  end
148
148
 
149
149
  describe 'Brazil' do
150
- it_splits '551112341234', ['55', '11', '1234', '1234']
150
+ it_splits '551122341234', ['55', '11', '2234', '1234']
151
151
  it_splits '5511981231234', ['55', '11', '98123', '1234'] # São Paulo's 9 digits mobile
152
- it_splits '552181231234', ['55', '21', '8123', '1234']
153
152
  it_splits '5521981231234', ['55', '21', '98123', '1234'] # Rio de Janeiro's 9 digits mobile
154
153
  it_splits '551931311234', ['55', '19', '3131', '1234']
155
154
  it_splits '5531991311234', ['55', '31', '99131', '1234'] # Belo Horizonte's 9th digit
@@ -157,6 +156,7 @@ describe 'country descriptions' do
157
156
  it_splits '5579991311234', ['55', '79', '99131', '1234'] # Sergipe's 9th digit
158
157
  it_splits '5547991311234', ['55', '47', '99131', '1234'] # Santa Catarina's 9th digit
159
158
  it_splits '5541991311234', ['55', '41', '99131', '1234'] # Parana's 9th digit
159
+ it_splits '556734212121', ['55', '67', '3421', '2121']
160
160
 
161
161
  context 'mobile numbers' do
162
162
  %w{
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.20.6
4
+ version: 2.20.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-09-06 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
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.4.14
118
+ rubygems_version: 3.4.19
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Fast international phone number (E164 standard) normalizing, splitting and