phony 2.20.10 → 2.20.11

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: 6f77d71a7b1294ad47e7eec9b97384f70dd514040fb7c4d6fb0869dce7570f24
4
- data.tar.gz: 10322550d30e582b15a761781d4d377d58520e71008087b1956e79e82ba61278
3
+ metadata.gz: f68626c2d1c6c1acec1bb90885078a4c304e104572eff7ec4861832d6a1a5b3f
4
+ data.tar.gz: 83f0cc53c664ae5850f7a2f645804a0cd61a839cb389f5108b4744df4bb3c20e
5
5
  SHA512:
6
- metadata.gz: 6f068f7840b8068bca4d1d23bfd78317169d941988480eedc05a195e68f96386cd6490d3f4b42975bf2e5d8f244522e1798556d5308bd9cbb5601ca30d25ec18
7
- data.tar.gz: 65c4b25791edb9e97c379571021ec145628c86621b8bf1738321de62ec12194a4fe69497280a9857cb749a29547b0411b9a5c2e27b96d470e0a0b87afda1d4a2
6
+ metadata.gz: 5532e887806791826d8b3796afe665e0510a691e55452461f5392bbc00c06e4222069603adbe6ffb28f174cb545ac50c9181a27730b042f2e6730f1c686479e4
7
+ data.tar.gz: a0d7f8366751cfb069c57ae99980d997b1d1b1cda370f25dac608c28f183e45b4746866c0c1b89fa2c68d9e4b8b9b33d19e70094eb31f7e4e0943167b5cf8fa7
@@ -127,6 +127,9 @@ Phony.define do
127
127
  one_of(ndcs_with_7_subscriber_digits) >> split(3,4) |
128
128
  one_of(ndcs_with_8_subscriber_digits) >> split(4,4) |
129
129
  one_of(mobile_with_trunk) >> split(5..8)|
130
+ one_of('1900') >> matched_split(
131
+ /\A\d{4}\z/ => [4],
132
+ /\A\d{6}\z/ => [6]) | # Premium rate
130
133
  # Govt reserved
131
134
  fixed(80) >> split(5) |
132
135
  fixed(69) >> split(1,5)
@@ -590,7 +590,9 @@ describe 'plausibility' do
590
590
  '+598 805 123 45']
591
591
  it_is_correct_for 'Vietnam', :samples => ['+84 24 41234567',
592
592
  '+84 28 41234567',
593
- '+84 23 61234567']
593
+ '+84 23 61234567',
594
+ '+84 1900 1212',
595
+ '+84 1900 541234']
594
596
  it_is_correct_for 'Yemen', :samples => [['+967 1 234 567', '+967 1 234 5678'],
595
597
  '+967 7 234 567',
596
598
  '+967 77 123 4567',
@@ -617,16 +619,16 @@ describe 'plausibility' do
617
619
  Phony.plausible?('+62 22 0000 0000').should be_truthy
618
620
  Phony.plausible?('+62 22 000 000 000').should be_truthy
619
621
  end
620
-
622
+
621
623
  it 'is correct for Italy' do
622
624
  Phony.plausible?('+39 0574 123').should be_falsy
623
625
  Phony.plausible?('+39 0574 1234').should be_truthy
624
626
  Phony.plausible?('+39 0574 12345').should be_falsy
625
-
627
+
626
628
  Phony.plausible?('+39 085 541').should be_falsy
627
629
  Phony.plausible?('+39 085 5410').should be_truthy
628
630
  Phony.plausible?('+39 085 54105').should be_truthy
629
-
631
+
630
632
  Phony.plausible?('+39 06 4991').should be_falsy
631
633
  Phony.plausible?('+39 06 49911').should be_truthy
632
634
  Phony.plausible?('+39 06 499112').should be_truthy
@@ -855,6 +855,8 @@ describe 'country descriptions' do
855
855
  it_splits '842841234567', ['84', '28', '4123', '4567'] # Ho Chi Minh City
856
856
  it_splits '84341234567', ['84', '34', '1234567'] # Viettel
857
857
  it_splits '84841234567', ['84', '84', '1234567'] # Vinaphone
858
+ it_splits '8419001212', ['84', '1900', '1212'] # Vinaphone
859
+ it_splits '841900541234', ['84', '1900', '541234'] # Vinaphone
858
860
  end
859
861
  describe 'Zambia' do
860
862
  it_splits '260211123456', ['260', '211', '123456'] # Fixed
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.10
4
+ version: 2.20.11
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-11-01 00:00:00.000000000 Z
11
+ date: 2023-12-05 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