phony 2.8.1 → 2.8.2
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/united_kingdom.rb +11 -11
- data/spec/functional/plausibility_spec.rb +3 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5db8b2a510f9d2e363fc24ade7837ace9db8d9b
|
4
|
+
data.tar.gz: e53b10c977d397d9b0c6dca770dbddd560b808e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded8e1e3d7206b255f7fe25978878a6e52866d466e5bf58bb2b382a107da7802775eb035425924b069a30a515f1300b6846ec126b508f7214033eec0aaa2763f
|
7
|
+
data.tar.gz: 5c8474e09d66faed68e6111212cd0b528e2da1f47ee696773264d1b18cf3a10eb9733115bb6b879f66438dd8270a096c67d41891aafb5b29f29e00c70fc3cd1b
|
@@ -790,15 +790,15 @@ four_digit_ndc = [
|
|
790
790
|
]
|
791
791
|
|
792
792
|
Phony.define do
|
793
|
-
country '44',
|
793
|
+
country '44',
|
794
794
|
trunk('0') |
|
795
|
-
one_of(mobile_ndc) >> split(6)
|
796
|
-
one_of(two_digit_ndc) >> split(4,4)
|
797
|
-
match(/^([58]00)\d{6}$/) >> split(6)
|
798
|
-
one_of(three_digit_ndc) >> split(3,4)
|
799
|
-
match(/^(16977)\d{4}$/) >> split(4)
|
800
|
-
one_of(five_digit_ndc) >> split(5)
|
801
|
-
one_of(variable_length_number) >> split(6)
|
802
|
-
one_of(four_digit_ndc) >> split(6)
|
803
|
-
fixed(4) >> split(6)
|
804
|
-
end
|
795
|
+
one_of(mobile_ndc) >> split(6) | # 4-6
|
796
|
+
one_of(two_digit_ndc) >> split(4,4) | # 2-4-4
|
797
|
+
match(/^([58]00)\d{6}$/) >> split(6) | # 3-6, Special handling for 500 and 800.
|
798
|
+
one_of(three_digit_ndc) >> split(3,4) | # 3-3-4
|
799
|
+
match(/^(16977)\d{4}$/) >> split(4) | # 5-4, Special handling for 16977.
|
800
|
+
one_of(five_digit_ndc) >> split(5) | # 5-5
|
801
|
+
one_of(variable_length_number) >> split(5..6) | # 4-6 and 4-5, in 40 areas.
|
802
|
+
one_of(four_digit_ndc) >> split(6) | # 4-6
|
803
|
+
fixed(4) >> split(6) # Catchall for undefined numbers.
|
804
|
+
end
|
@@ -821,6 +821,9 @@ describe 'plausibility' do
|
|
821
821
|
'+971 600 641 234',
|
822
822
|
'+971 500 641 234',
|
823
823
|
'+971 200 641 234']
|
824
|
+
|
825
|
+
it_is_correct_for 'United Kingdom', :samples => ['+44 1827 50111']
|
826
|
+
|
824
827
|
it_is_correct_for 'Uruguay (Eastern Republic of)', :samples => ['+598 800 123 45',
|
825
828
|
'+598 2 012 3456',
|
826
829
|
'+598 21 123 456',
|