phony 2.15.28 → 2.15.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/phony/countries.rb +17 -5
- data/spec/functional/plausibility_spec.rb +8 -0
- data/spec/lib/phony/countries_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60cca0bdd96643bef48d567cb6f087aaaa5ac1a8
|
|
4
|
+
data.tar.gz: 470c4ea610e4886263b0ad715583f9bf13efe240
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bc31e7baf9450aa6b0110640f2fc13af396e6b5db8eac656eb4b126f510f48d2432f56a015e9096cd3dbeecdb7b2d682c23bda9a30f86b18ad6bd3743174f1e
|
|
7
|
+
data.tar.gz: c65e9f7b42afa62c6ee94c1cb164c919d5cb047459ecd0d337acc46cd185b2dfa81966a59f574c2437fbf6b4baba7eb10a19b78f826e61d6fabe621c6dc34277
|
data/lib/phony/countries.rb
CHANGED
|
@@ -634,11 +634,23 @@ Phony.define do
|
|
|
634
634
|
#
|
|
635
635
|
country '358',
|
|
636
636
|
trunk('0') |
|
|
637
|
-
match(/^([
|
|
638
|
-
match(/^([
|
|
639
|
-
match(/^(
|
|
640
|
-
|
|
641
|
-
|
|
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 '
|
|
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.
|
|
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-
|
|
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
|