phony 2.8.6 → 2.8.7

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
  SHA1:
3
- metadata.gz: fd5cdb06a66334890f3ff3b0112b3324ebfab8a6
4
- data.tar.gz: 648a338a8a86a3ed26760be57e2975ae72493021
3
+ metadata.gz: 8e2d03fb9d2d806c19a40868f855ba47e9ec5d1e
4
+ data.tar.gz: 6d46d7b99a432ac114aa827805bf6d226277e564
5
5
  SHA512:
6
- metadata.gz: b51d7021c27867e0cc359378c58038ee962f1445962a8c6990d0cfcc45cd1cafed4604834a862700a5644021be7109a37d5f512f27b529fa9b860192eb4dd1bc
7
- data.tar.gz: 73608bb4ad43b3db4239b3769ea8c979f568811c5114224a6153e5df59fb3579a0da81805579378627af1ac32bc3e7216dd9ad270c1446a5def037d279aa98bb
6
+ metadata.gz: 6fedc1ec8edfcc93b2a5864ec3521426ac70fd4509a84d20c9e856d33d3933804552a0de67651946ad99e517208c720e778e80548f3d6f6d5c81fdf997db70e1
7
+ data.tar.gz: 81906816fd112f07dee1fdbf10a48510f136af5b751c9ddf94fa535f332959eb266eaa0bac23a3403d27d631e38819d90683993972626ebb0ff69e71f0c4b09a
@@ -548,10 +548,13 @@ describe 'country descriptions' do
548
548
  it_splits '2399920012', %w(239 9 920 012)
549
549
  end
550
550
  describe 'South Korea' do
551
- it { Phony.split('82212345678').should == ['82', '2', '1234', '5678'] } # Seoul
552
- it { Phony.split('825112345678').should == ['82', '51', '1234', '5678'] } # Busan
553
- it { Phony.split('821027975588').should == ['82', '10', '2797', '5588'] } # mobile
554
- it { Phony.split('821087971234').should == ['82', '10', '8797', '1234'] } # mobile
551
+ it_splits '82212345678', ['82', '2', '1234', '5678'] # Seoul
552
+ it_splits '825112345678', ['82', '51', '1234', '5678'] # Busan
553
+ it_splits '821027975588', ['82', '10', '2797', '5588'] # mobile
554
+ it_splits '821087971234', ['82', '10', '8797', '1234'] # mobile
555
+ end
556
+ describe 'Serbia' do
557
+ it_splits '38163512529', ['381', '63', '512', '529']
555
558
  end
556
559
  describe 'South Sudan' do
557
560
  it_splits '211123212345', ['211', '123', '212', '345']
@@ -561,31 +564,31 @@ describe 'country descriptions' do
561
564
  it_splits '249187171100', ['249', '18', '717', '1100']
562
565
  end
563
566
  describe 'Thailand' do
564
- it { Phony.split('6621231234').should == ['66', '2', '123', '1234'] } # Bangkok
565
- it { Phony.split('6636123123').should == ['66', '36', '123', '123'] } # Lop Buri
566
- it { Phony.split('66851234567').should == ['66', '851', '234', '567'] } # Lop Buri
567
+ it_splits '6621231234', ['66', '2', '123', '1234'] # Bangkok
568
+ it_splits '6636123123', ['66', '36', '123', '123'] # Lop Buri
569
+ it_splits '66851234567', ['66', '851', '234', '567'] # Lop Buri
567
570
  end
568
571
  describe 'Tunesia' do
569
- it { Phony.split('21611231234').should == ['216', '1', '123', '1234'] } # Ariana
570
- it { Phony.split('21621231234').should == ['216', '2', '123', '1234'] } # Bizerte
572
+ it_splits '21611231234', ['216', '1', '123', '1234'] # Ariana
573
+ it_splits '21621231234', ['216', '2', '123', '1234'] # Bizerte
571
574
  end
572
575
  describe 'Salvador (El)' do
573
- it { Phony.split('50321121234').should == ['503', '2112', '1234'] } # Fixed number
574
- it { Phony.split('50361121234').should == ['503', '6112', '1234'] } # Mobile number
576
+ it_splits '50321121234', ['503', '2112', '1234'] # Fixed number
577
+ it_splits '50361121234', ['503', '6112', '1234'] # Mobile number
575
578
  end
576
579
 
577
580
  describe 'Singapore' do
578
- it { Phony.split('6561231234').should == ['65', false, '6123', '1234'] } # Fixed line
581
+ it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
579
582
  end
580
583
  describe 'Slovakia' do
581
- it { Phony.split('421912123456').should == ['421', '912', '123456'] } # Mobile
582
- it { Phony.split('421212345678').should == ['421', '2', '12345678'] } # Bratislava
583
- it { Phony.split('421371234567').should == ['421', '37', '1234567'] } # Nitra / Other
584
+ it_splits '421912123456', ['421', '912', '123456'] # Mobile
585
+ it_splits '421212345678', ['421', '2', '12345678'] # Bratislava
586
+ it_splits '421371234567', ['421', '37', '1234567'] # Nitra / Other
584
587
  end
585
588
 
586
589
  describe 'Slovenia' do
587
- it { Phony.split('38651234567').should == ['386', '51', '234', '567'] } # Mobile
588
- it { Phony.split('38611234567').should == ['386', '1', '123', '4567'] } # LJUBLJANA
590
+ it_splits '38651234567', ['386', '51', '234', '567'] # Mobile
591
+ it_splits '38611234567', ['386', '1', '123', '4567'] # LJUBLJANA
589
592
  end
590
593
 
591
594
  describe 'Spain' do
@@ -597,104 +600,104 @@ describe 'country descriptions' do
597
600
  end
598
601
 
599
602
  describe 'Sri Lanka' do
600
- it { Phony.split('94711231212').should == ['94', '71', '123', '12', '12'] } # Mobile
603
+ it_splits '94711231212', ['94', '71', '123', '12', '12'] # Mobile
601
604
  end
602
605
 
603
606
  describe 'Sweden' do
604
- it { Phony.split('46812345678').should == ['46', '8', '123', '45', '678'] } # Stockholm
605
- it { Phony.split('46111234567').should == ['46', '11', '123', '45', '67'] }
606
- it { Phony.split('46721234567').should == ['46', '72', '123', '45', '67'] } # mobile
607
- it { Phony.split('46125123456').should == ['46', '125', '123', '456'] }
607
+ it_splits '46812345678', ['46', '8', '123', '45', '678'] # Stockholm
608
+ it_splits '46111234567', ['46', '11', '123', '45', '67']
609
+ it_splits '46721234567', ['46', '72', '123', '45', '67'] # mobile
610
+ it_splits '46125123456', ['46', '125', '123', '456']
608
611
  end
609
612
  describe 'Switzerland' do
610
- it { Phony.split('41443643532').should == ['41', '44', '364', '35', '32'] } # Zurich (usually)
611
- it { Phony.split('41800334455').should == ['41', '800', '334', '455'] } # Service number
613
+ it_splits '41443643532', ['41', '44', '364', '35', '32'] # Zurich (usually)
614
+ it_splits '41800334455', ['41', '800', '334', '455'] # Service number
612
615
  end
613
616
  describe 'Tanzania' do
614
- it { Phony.split('255221231234').should == ['255', '22', '123', '1234'] } # Dar Es Salaam
615
- it { Phony.split('255651231234').should == ['255', '65', '123', '1234'] } # TIGO
616
- it { Phony.split('255861123123').should == ['255', '861', '123', '123'] } # Special Rates
617
+ it_splits '255221231234', ['255', '22', '123', '1234'] # Dar Es Salaam
618
+ it_splits '255651231234', ['255', '65', '123', '1234'] # TIGO
619
+ it_splits '255861123123', ['255', '861', '123', '123'] # Special Rates
617
620
  end
618
621
  describe 'Turkey' do
619
- it { Phony.split('903121234567').should == ['90', '312', '123', '4567'] } # Ankara
622
+ it_splits '903121234567', ['90', '312', '123', '4567'] # Ankara
620
623
  end
621
624
  describe 'Uganda' do
622
- it { Phony.split('256414123456').should == ['256', '41', '4123456'] } # Kampania
623
- it { Phony.split('256464441234').should == ['256', '464', '441234'] } # Mubende
625
+ it_splits '256414123456', ['256', '41', '4123456'] # Kampania
626
+ it_splits '256464441234', ['256', '464', '441234'] # Mubende
624
627
  end
625
628
  describe 'The UK' do
626
- it { Phony.split('442075671113').should == ['44', '20', '7567', '1113'] } # [2+8] London
627
- it { Phony.split('442920229901').should == ['44', '29', '2022', '9901'] } # [2+8] Cardiff
628
- it { Phony.split('441134770011').should == ['44', '113', '477', '0011'] } # [3+7] Leeds
629
- it { Phony.split('441412770022').should == ['44', '141', '277', '0022'] } # [3+7] Glasgow
630
- it { Phony.split('441204500532').should == ['44', '1204', '500532'] } # [4+6] Bolton
631
- it { Phony.split('44120462532').should == ['44', '1204', '62532'] } # [4+5] Bolton
632
- it { Phony.split('441333247700').should == ['44', '1333', '247700'] } # [4+6] Leven (Fife)
633
- it { Phony.split('441382229845').should == ['44', '1382', '229845'] } # [4+6] Dundee
634
- it { Phony.split('441420700378').should == ['44', '1420', '700378'] } # [4+6] Alton
635
- it { Phony.split('44142080378').should == ['44', '1420', '80378'] } # [4+5] Alton
636
- it { Phony.split('441475724688').should == ['44', '1475', '724688'] } # [4+6] Greenock
637
- it { Phony.split('441539248756').should == ['44', '1539', '248756'] } # [4+6] Kendal (Mixed area)
638
- it { Phony.split('441539648788').should == ['44', '15396', '48788'] } # [5+5] Sedbergh (Mixed area)
639
- it { Phony.split('441652757248').should == ['44', '1652', '757248'] } # [4+6] Brigg
640
- it { Phony.split('441664333456').should == ['44', '1664', '333456'] } # [4+6] Melton Mowbray
641
- it { Phony.split('441697222555').should == ['44', '1697', '222555'] } # [4+6] Brampton (Mixed area)
642
- it { Phony.split('441697388555').should == ['44', '16973', '88555'] } # [5+5] Wigton (Mixed area)
643
- it { Phony.split('441697433777').should == ['44', '16974', '33777'] } # [5+5] Raughton Head (Mixed area)
644
- it { Phony.split('44169772333').should == ['44', '16977', '2333'] } # [5+4] Brampton (Mixed area)
645
- it { Phony.split('441697744888').should == ['44', '16977', '44888'] } # [5+5] Brampton (Mixed area)
646
- it { Phony.split('441757850526').should == ['44', '1757', '850526'] } # [4+6] Selby
647
- it { Phony.split('441890234567').should == ['44', '1890', '234567'] } # [4+6] Coldstream (ELNS area)
648
- it { Phony.split('441890595378').should == ['44', '1890', '595378'] } # [4+6] Ayton (ELNS area)
649
- it { Phony.split('441931306526').should == ['44', '1931', '306526'] } # [4+6] Shap
650
- it { Phony.split('441946555777').should == ['44', '1946', '555777'] } # [4+6] Whitehaven (Mixed area)
651
- it { Phony.split('44194662888').should == ['44', '1946', '62888'] } # [4+5] Whitehaven (Mixed area)
652
- it { Phony.split('441946722444').should == ['44', '19467', '22444'] } # [5+5] Gosforth (Mixed area)
653
- it { Phony.split('441987705337').should == ['44', '1987', '705337'] } # [4+6] Ebbsfleet
654
- it { Phony.split('443005828323').should == ['44', '300', '582', '8323'] } # Non-geographic (NTS)
655
- it { Phony.split('443334253344').should == ['44', '333', '425', '3344'] } # Non-geographic (NTS)
656
- it { Phony.split('443437658834').should == ['44', '343', '765', '8834'] } # Non-geographic (NTS)
657
- it { Phony.split('443452273512').should == ['44', '345', '227', '3512'] } # Non-geographic (NTS)
658
- it { Phony.split('443707774444').should == ['44', '370', '777', '4444'] } # Non-geographic (NTS)
659
- it { Phony.split('443725247722').should == ['44', '372', '524', '7722'] } # Non-geographic (NTS)
660
- it { Phony.split('44500557788').should == ['44', '500', '557788'] } # Freefone (500 + 6)
661
- it { Phony.split('445575671113').should == ['44', '55', '7567', '1113'] } # Corporate numbers
662
- it { Phony.split('445644775533').should == ['44', '56', '4477', '5533'] } # LIECS/VoIP
663
- it { Phony.split('447020229901').should == ['44', '70', '2022', '9901'] } # Personal numbers
664
- it { Phony.split('447688554246').should == ['44', '76', '8855', '4246'] } # Pager
665
- it { Phony.split('447180605207').should == ['44', '7180', '605207'] } # Mobile
666
- it { Phony.split('447480605207').should == ['44', '7480', '605207'] } # Mobile
667
- it { Phony.split('447624605207').should == ['44', '7624', '605207'] } # Mobile (Isle of Man)
668
- it { Phony.split('447780605207').should == ['44', '7780', '605207'] } # Mobile
669
- it { Phony.split('447980605207').should == ['44', '7980', '605207'] } # Mobile
670
- it { Phony.split('44800557788').should == ['44', '800', '557788'] } # Freefone (800 + 6)
671
- it { Phony.split('448084682355').should == ['44', '808', '468', '2355'] } # Freefone (808 + 7)
672
- it { Phony.split('448005878323').should == ['44', '800', '587', '8323'] } # Freefone (800 + 7), regression
673
- it { Phony.split('448437777334').should == ['44', '843', '777', '7334'] } # Non-geographic (NTS)
674
- it { Phony.split('448457777334').should == ['44', '845', '777', '7334'] } # Non-geographic (NTS)
675
- it { Phony.split('448707777334').should == ['44', '870', '777', '7334'] } # Non-geographic (NTS)
676
- it { Phony.split('448727777334').should == ['44', '872', '777', '7334'] } # Non-geographic (NTS)
677
- it { Phony.split('449052463456').should == ['44', '905', '246', '3456'] } # Non-geographic (PRS)
678
- it { Phony.split('449122463456').should == ['44', '912', '246', '3456'] } # Non-geographic (PRS)
679
- it { Phony.split('449832463456').should == ['44', '983', '246', '3456'] } # Non-geographic (SES)
629
+ it_splits '442075671113', ['44', '20', '7567', '1113'] # [2+8] London
630
+ it_splits '442920229901', ['44', '29', '2022', '9901'] # [2+8] Cardiff
631
+ it_splits '441134770011', ['44', '113', '477', '0011'] # [3+7] Leeds
632
+ it_splits '441412770022', ['44', '141', '277', '0022'] # [3+7] Glasgow
633
+ it_splits '441204500532', ['44', '1204', '500532'] # [4+6] Bolton
634
+ it_splits '44120462532', ['44', '1204', '62532'] # [4+5] Bolton
635
+ it_splits '441333247700', ['44', '1333', '247700'] # [4+6] Leven (Fife)
636
+ it_splits '441382229845', ['44', '1382', '229845'] # [4+6] Dundee
637
+ it_splits '441420700378', ['44', '1420', '700378'] # [4+6] Alton
638
+ it_splits '44142080378', ['44', '1420', '80378'] # [4+5] Alton
639
+ it_splits '441475724688', ['44', '1475', '724688'] # [4+6] Greenock
640
+ it_splits '441539248756', ['44', '1539', '248756'] # [4+6] Kendal (Mixed area)
641
+ it_splits '441539648788', ['44', '15396', '48788'] # [5+5] Sedbergh (Mixed area)
642
+ it_splits '441652757248', ['44', '1652', '757248'] # [4+6] Brigg
643
+ it_splits '441664333456', ['44', '1664', '333456'] # [4+6] Melton Mowbray
644
+ it_splits '441697222555', ['44', '1697', '222555'] # [4+6] Brampton (Mixed area)
645
+ it_splits '441697388555', ['44', '16973', '88555'] # [5+5] Wigton (Mixed area)
646
+ it_splits '441697433777', ['44', '16974', '33777'] # [5+5] Raughton Head (Mixed area)
647
+ it_splits '44169772333', ['44', '16977', '2333'] # [5+4] Brampton (Mixed area)
648
+ it_splits '441697744888', ['44', '16977', '44888'] # [5+5] Brampton (Mixed area)
649
+ it_splits '441757850526', ['44', '1757', '850526'] # [4+6] Selby
650
+ it_splits '441890234567', ['44', '1890', '234567'] # [4+6] Coldstream (ELNS area)
651
+ it_splits '441890595378', ['44', '1890', '595378'] # [4+6] Ayton (ELNS area)
652
+ it_splits '441931306526', ['44', '1931', '306526'] # [4+6] Shap
653
+ it_splits '441946555777', ['44', '1946', '555777'] # [4+6] Whitehaven (Mixed area)
654
+ it_splits '44194662888', ['44', '1946', '62888'] # [4+5] Whitehaven (Mixed area)
655
+ it_splits '441946722444', ['44', '19467', '22444'] # [5+5] Gosforth (Mixed area)
656
+ it_splits '441987705337', ['44', '1987', '705337'] # [4+6] Ebbsfleet
657
+ it_splits '443005828323', ['44', '300', '582', '8323'] # Non-geographic (NTS)
658
+ it_splits '443334253344', ['44', '333', '425', '3344'] # Non-geographic (NTS)
659
+ it_splits '443437658834', ['44', '343', '765', '8834'] # Non-geographic (NTS)
660
+ it_splits '443452273512', ['44', '345', '227', '3512'] # Non-geographic (NTS)
661
+ it_splits '443707774444', ['44', '370', '777', '4444'] # Non-geographic (NTS)
662
+ it_splits '443725247722', ['44', '372', '524', '7722'] # Non-geographic (NTS)
663
+ it_splits '44500557788', ['44', '500', '557788'] # Freefone (500 + 6)
664
+ it_splits '445575671113', ['44', '55', '7567', '1113'] # Corporate numbers
665
+ it_splits '445644775533', ['44', '56', '4477', '5533'] # LIECS/VoIP
666
+ it_splits '447020229901', ['44', '70', '2022', '9901'] # Personal numbers
667
+ it_splits '447688554246', ['44', '76', '8855', '4246'] # Pager
668
+ it_splits '447180605207', ['44', '7180', '605207'] # Mobile
669
+ it_splits '447480605207', ['44', '7480', '605207'] # Mobile
670
+ it_splits '447624605207', ['44', '7624', '605207'] # Mobile (Isle of Man)
671
+ it_splits '447780605207', ['44', '7780', '605207'] # Mobile
672
+ it_splits '447980605207', ['44', '7980', '605207'] # Mobile
673
+ it_splits '44800557788', ['44', '800', '557788'] # Freefone (800 + 6)
674
+ it_splits '448084682355', ['44', '808', '468', '2355'] # Freefone (808 + 7)
675
+ it_splits '448005878323', ['44', '800', '587', '8323'] # Freefone (800 + 7), regression
676
+ it_splits '448437777334', ['44', '843', '777', '7334'] # Non-geographic (NTS)
677
+ it_splits '448457777334', ['44', '845', '777', '7334'] # Non-geographic (NTS)
678
+ it_splits '448707777334', ['44', '870', '777', '7334'] # Non-geographic (NTS)
679
+ it_splits '448727777334', ['44', '872', '777', '7334'] # Non-geographic (NTS)
680
+ it_splits '449052463456', ['44', '905', '246', '3456'] # Non-geographic (PRS)
681
+ it_splits '449122463456', ['44', '912', '246', '3456'] # Non-geographic (PRS)
682
+ it_splits '449832463456', ['44', '983', '246', '3456'] # Non-geographic (SES)
680
683
  end
681
684
  describe 'US' do
682
- it { Phony.split('15551115511').should == ['1', '555', '111', '5511'] }
685
+ it_splits '15551115511', ['1', '555', '111', '5511']
683
686
  end
684
687
  describe 'Venezuela' do
685
- it { Phony.split('582121234567').should == ['58', '212', '1234567'] }
688
+ it_splits '582121234567', ['58', '212', '1234567']
686
689
  end
687
690
  describe 'Vietnam' do
688
- it { Phony.split('8498123456').should == ['84', '98', '123456'] } # Viettel Mobile
689
- it { Phony.split('8499612345').should == ['84', '996', '12345'] } # GTel
690
- it { Phony.split('84412345678').should == ['84', '4', '1234', '5678'] } # Hanoi
691
+ it_splits '8498123456', ['84', '98', '123456'] # Viettel Mobile
692
+ it_splits '8499612345', ['84', '996', '12345'] # GTel
693
+ it_splits '84412345678', ['84', '4', '1234', '5678'] # Hanoi
691
694
  end
692
695
  describe 'Zambia' do
693
696
  it_splits '260977640895', ['260', '97', '7640895'] # mobile
694
697
  it_splits '260211229049', ['260', '211', '229049'] # fixed
695
698
  end
696
699
  describe 'New Zealand' do
697
- it { Phony.split('6491234567').should == ['64', '9', '123', '4567'] }
700
+ it_splits '6491234567', ['64', '9', '123', '4567']
698
701
  end
699
702
  describe 'Bhutan (Kingdom of)' do
700
703
  it_splits '9759723642', %w(975 9 723 642)
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.8.6
4
+ version: 2.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2014-12-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