phony 2.18.13 → 2.18.14

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: 7e14e2c7d06393753fce0427aa20663f54f193738bfd16b540a36e76d5ba2acc
4
- data.tar.gz: 3d88d8b49030814139b5bcc32f6e527d8cf6320cd94276a24e9d80518dc00f28
3
+ metadata.gz: aeda5c706089f2345c5d9a474749f8088a728adedd86f84ce69443540b57612e
4
+ data.tar.gz: 3d2fd865a0bbd0572a8444988e7c53809a0688e98b85b218191cfdbcfe96758c
5
5
  SHA512:
6
- metadata.gz: 1fa00cd7d9c0e5610eece54633e47f5af65996a35697b564da8b021e5280139c8151544c9356716db899c33e89aca258d7c150e95d01d6e01069baf122908797
7
- data.tar.gz: b3de10ec071c5db69937bc2bd169def6f56ab3a127d2f7d18945438b1da2fb2cd6e022ecb74db40ec1a2efe27e76b2b379ec96ac6b3dbd041789d24e5684a29b
6
+ metadata.gz: 301e5a05da90d67f3943ca07d3a42b9def5c4c138b534235152e80b7450068315f1b635fda959c7f6b550fa6e5901ccff0aae9eaeae5d5126aa04cd46e7963ab
7
+ data.tar.gz: bc888bc9e4aa0920f5ba53c1ff264317c7cecb762cfc7f1c386dfa62c6daf6b60218efc5a51725d65a2379f5ac024cbbe62899b6724dff8a96dc4326bad5688e
@@ -257,6 +257,7 @@ Phony.define do
257
257
  trunk('0') |
258
258
  # 7/10 digits for area code '2'.
259
259
  match(/\A(2)\d{10}\z/) >> split(10) |
260
+ match(/\A(2)\d{8}\z/) >> split(8) |
260
261
  one_of('2') >> split(7) |
261
262
  # mobile
262
263
  match(/\A([89]\d\d)\d{7}\z/) >> split(7) |
@@ -28,5 +28,8 @@ Phony.define do
28
28
  one_of(service) >> split(8) |
29
29
  one_of(mobile) >> split(4,4) |
30
30
  one_of(ndcs) >> split(4,4) |
31
- fixed(3) >> split(4,4)
31
+ fixed(3) >> matched_split(
32
+ /\A\d{7}\z/ => [3,4],
33
+ /\A\d{8}\z/ => [4,4]
34
+ )
32
35
  end
@@ -607,6 +607,7 @@ describe 'plausibility' do
607
607
  end
608
608
 
609
609
  it 'is correct for Philippine' do
610
+ Phony.plausible?('+63 2 89889999').should be_truthy
610
611
  Phony.plausible?('+63 976 1234567').should be_truthy # mobile phone with area code 9
611
612
  Phony.plausible?('+63 876 1234567').should be_truthy # mobile phone with area code 8
612
613
  end
@@ -215,6 +215,7 @@ describe 'country descriptions' do
215
215
  describe 'China' do
216
216
  it_splits '862112345678', ['86', '21', '1234', '5678'] # Shanghai
217
217
  it_splits '8675582193447', ['86', '755', '8219', '3447'] # Shenzhen
218
+ it_splits '869511234567', ['86', '951', '123', '4567'] # Yinchuan
218
219
 
219
220
  context 'mobile numbers' do
220
221
  %w{
@@ -613,6 +614,7 @@ describe 'country descriptions' do
613
614
  end
614
615
  describe 'Philippines' do
615
616
  it_splits '6321234567', ['63', '2', '1234567']
617
+ it_splits '63289889999', ['63', '2', '89889999']
616
618
  it_splits '6321234567890', ['63', '2', '1234567890']
617
619
  it_splits '632123456789012', ['63', '2', '123456789012']
618
620
  it_splits '639121234567', ['63', '912', '1234567']
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.13
4
+ version: 2.18.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-24 00:00:00.000000000 Z
11
+ date: 2020-06-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