phony 2.15.28 → 2.15.29

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: 564bbb19f1a422a0f0c4e35adaa6aeaff0058680
4
- data.tar.gz: d451f370b8e093e0dd3df21fb54f918f5acf18d3
3
+ metadata.gz: 60cca0bdd96643bef48d567cb6f087aaaa5ac1a8
4
+ data.tar.gz: 470c4ea610e4886263b0ad715583f9bf13efe240
5
5
  SHA512:
6
- metadata.gz: 0e6b5927b390e7e84e5a577823e853d42ee9514610aa6c713a577c8290b963b80a50d142aa2111b79e6d1bda9619ab72fbc62605c32b1714ef7956a0d7b67fa5
7
- data.tar.gz: 5894bca88a3ee1cfeb7ccbabbfca7fc5b6d08d942ee4ded3f2ce82081862c723029bac31360206f7d26f08495cdc8b8ecc15d1d3fb5aadf771ef7d705e2439ed
6
+ metadata.gz: 6bc31e7baf9450aa6b0110640f2fc13af396e6b5db8eac656eb4b126f510f48d2432f56a015e9096cd3dbeecdb7b2d682c23bda9a30f86b18ad6bd3743174f1e
7
+ data.tar.gz: c65e9f7b42afa62c6ee94c1cb164c919d5cb047459ecd0d337acc46cd185b2dfa81966a59f574c2437fbf6b4baba7eb10a19b78f826e61d6fabe621c6dc34277
@@ -634,11 +634,23 @@ Phony.define do
634
634
  #
635
635
  country '358',
636
636
  trunk('0') |
637
- match(/^([1-3]0)\d+$/) >> split(3,3,0..6) | # Service/subscriber
638
- match(/^([6-8]00)\d+$/) >> split(3,3) | # Service
639
- match(/^(457|4\d|50)\d+$/) >> split(3,2,0..2) | # Mobile
640
- one_of('2','3','5','6','8','9') >> split(3,2..4) | # Short NDCs
641
- fixed(2) >> split(3,3) # 2-digit NDCs
637
+ match(/^(600[3-5]\d|601\d\d|700[3457]\d|7500[12]|7532[12]|7575[12]|7598[12])\d{3,4}$/) >> split(3..4) | # national service numbers, 5-digit NDC
638
+ match(/^(753[02][3-9]|7575[3-9]|7598[3-9])\d{3,5}$/) >> split(3..5) | # national subscriber numbers, 5-digit NDC
639
+ match(/^(73[0-4]\d\d)\d{5}$/) >> split(5) | # national subscriber numbers, 5-digit NDC (starting with 073)
640
+ match(/^(202[023]|209[8-9]|600[0126-9]|700[0126]|7099|800\d)\d{4,5}$/) >> split(2, 2..3) | # national service numbers, 4-digit NDCs
641
+ match(/^(606\d|70[78]\d)\d{6}$/) >> split(3, 3) | # national service numbers, 4-digit NDCs (starting with 0606/0707/0708)
642
+ match(/^(202[14-9]|209[0-7])\d{4,6}$/) >> split(3, 1..3) | # national subscriber numbers, 4-digit NDCs
643
+ match(/^(45[45789]\d)\d{2,6}$/) >> split(2, 0..4) | # mobile numbers, 4-digit NDCs
644
+ match(/^([123]00|602)\d{5,6}$/) >> split(3, 2..3) | # national service numbers, 3-digit NDCs
645
+ match(/^(10[1-9]|20[13-8]|30[1-9]|73[5-9])\d{5,7}$/) >> split(3, 2..4) | # national subscriber numbers, 3-digit NDCs
646
+ match(/^(71\d)\d{6}$/) >> split(3, 3) | # national subscriber numbers, 3-digit NDCs (starting with 071)
647
+ match(/^(73[5-9])\d{7}$/) >> split(3, 4) | # national subscriber numbers, 3-digit NDCs (starting with 073)
648
+ match(/^(43\d|45[0-36])\d{5,7}$/) >> split(3, 2..4) | # mobile numbers, 3-digit NDCs
649
+ match(/^(49\d)\d{8}$/) >> split(3, 3, 2) | # mobile numbers, 3-digit NDCs (starting with 049)
650
+ match(/^([235]9)\d{6,8}$/) >> split(3, 3, 0..2) | # national subscriber numbers, 2-digit NDCs
651
+ match(/^(4[0124678]|50)\d{4,8}$/) >> split(3, 1..5) | # mobile numbers, 2-digit NDCs
652
+ one_of('2','3','5','6','8','9') >> split(3,1..5) | # Short NDCs
653
+ fixed(2) >> split(3, 0..4) # 2-digit NDCs
642
654
 
643
655
  # Bulgaria
644
656
  #
@@ -64,13 +64,21 @@ describe 'plausibility' do
64
64
  it_is_correct_for 'Faroe Islands', :samples => '+298 969 597'
65
65
  it_is_correct_for 'Fiji (Republic of)', :samples => '+679 998 2441'
66
66
  it 'is correct for Finland' do
67
+ Phony.plausible?('+358 50 123 4').should be_true
67
68
  Phony.plausible?('+358 50 123 45').should be_true
68
69
  Phony.plausible?('+358 50 123 45 6').should be_true
69
70
  Phony.plausible?('+358 50 123 45 67').should be_true
71
+ Phony.plausible?('+358 50 123 45 678').should be_true
72
+ Phony.plausible?('+358 49 123 456 789').should be_true
73
+ Phony.plausible?('+358 18 1234').should be_true
74
+ Phony.plausible?('+358 9 1234').should be_true
70
75
  Phony.plausible?('+358 9 123 45').should be_true
71
76
  Phony.plausible?('+358 9 123 456').should be_true
72
77
  Phony.plausible?('+358 9 123 4567').should be_true
73
78
  Phony.plausible?('+358 20 1470 740').should be_true
79
+ Phony.plausible?('+358 29 123 4567').should be_true
80
+ Phony.plausible?('+358 75323 1234').should be_true
81
+ Phony.plausible?('+358 50 123 456 789').should be_false
74
82
  end
75
83
  it_is_correct_for 'French Guiana (French Department of)', :samples => '+594 594 123 456'
76
84
  it_is_correct_for "French Polynesia (Territoire français d'outre-mer)", :samples => '+689 87 27 84 00'
@@ -220,7 +220,7 @@ describe 'country descriptions' do
220
220
  it_splits '3589123123', ['358', '9', '123', '123'] # Helsinki
221
221
  it_splits '3581912312', ['358', '19', '123', '12'] # Nylandia
222
222
  it_splits '3585012312', ['358', '50', '123', '12'] # Mobile
223
- it_splits '358600123', ['358', '600', '123'] # Service
223
+ it_splits '35860012345', ['358', '6001', '23', '45'] # Service
224
224
  end
225
225
  describe 'France' do
226
226
  it_splits '33112345678', ['33', '1', '12','34','56','78'] # Paris
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.15.28
4
+ version: 2.15.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-08-30 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