phony 2.20.9 → 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: 3d74174244f95d313c9addce1e9bdf6977534fb4accc356566f6e4435b183ec6
4
- data.tar.gz: e694651c6c3293c9b967ada7eb306913114ede441ed99a920f7acae49186f9a2
3
+ metadata.gz: f68626c2d1c6c1acec1bb90885078a4c304e104572eff7ec4861832d6a1a5b3f
4
+ data.tar.gz: 83f0cc53c664ae5850f7a2f645804a0cd61a839cb389f5108b4744df4bb3c20e
5
5
  SHA512:
6
- metadata.gz: cb0dbf2b5a0e42436c116cb4047dc4848783de6caff1889430b1b3f2b32925ba6eb24428217c1841278ca248f69bb5ec44a8987e6a7beacd29f31147589bd442
7
- data.tar.gz: 6a586b100039f976fef6f800d5021e6219dbd26c80d22c3945dd588573e65e3f0e64e0e7929b97c87b119b5bc2204386baa9c7fd3b1ebf420830dab247aaa510
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)
@@ -494,7 +494,7 @@ Phony.define do
494
494
  one_of('802') >> split(3,3) | # national rate
495
495
  one_of(%w(251 252 271 272 281 282 293)) >> split(3,2) |
496
496
  one_of(%w(21 23 24 26)) >> split(3,3) |
497
- one_of(%w(82 84 86)) >> split(4,3) | # mobile
497
+ one_of(%w(82 83 84 85 86 87)) >> split(4,3) | # mobile
498
498
  one_of('89') >> split(4,3) | # satellite GMPCS
499
499
  one_of('7') >> split(4,4) | # universal access
500
500
  one_of('9') >> split(4,4) | # premium rate
@@ -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.9
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-10-16 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