phony 2.20.11 → 2.20.13
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 +7 -14
- data/spec/functional/plausibility_spec.rb +1 -0
- data/spec/lib/phony/countries_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8a3040e536d7eba5507cc4ca91be6ea1acbf1706a31ad54d3fadc9baadbffd2
|
|
4
|
+
data.tar.gz: 7646e570c51156f9a931af73c75ea5548d27e802663647517a31bf0f64278047
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5339eca176062f10c68f27e7174fb91ddb8df1a3133f452f02b5262bdca14a1bbfe7074375a231e0dabceaee25bf83210ce755c561982c97d1f27dae11b786f3
|
|
7
|
+
data.tar.gz: 4b40657f420fd789a95c0ed9903cb911d9829a1822cdcc283498380aa816812637dddadf429a040c1ae1d65c2c69823682698d27437819c4451eb884373423b0
|
data/lib/phony/countries.rb
CHANGED
|
@@ -517,18 +517,11 @@ Phony.define do
|
|
|
517
517
|
# https://en.wikipedia.org/wiki/Telephone_numbers_in_Madagascar
|
|
518
518
|
# http://www.itu.int/oth/T020200007F/en
|
|
519
519
|
country '261',
|
|
520
|
-
# none >> matched_split(
|
|
521
|
-
# /\A20\d+\z/ => [2,2,3,2], # Telecom Malagasy (Telma)
|
|
522
|
-
# /\A32\d+\z/ => [2,2,3,2], # mobile Orange Madagascar
|
|
523
|
-
# /\A33\d+\z/ => [2,2,3,2], # mobile Airtel Madagascar
|
|
524
|
-
# /\A34\d+\z/ => [2,2,3,2], # mobile Telecom Malagasy (Telma)
|
|
525
|
-
# /\A38\d+\z/ => [2,2,3,2], # mobile Telecom Malagasy (Telma)
|
|
526
|
-
# /\A39\d+\z => [2,2,3,2] # mobile Blueline
|
|
527
|
-
# ),
|
|
528
520
|
match(/\A(20)\d+\z/) >> split(2,3,2) | # fix Telecom Malagasy (Telma)
|
|
529
521
|
match(/\A(32)\d+\z/) >> split(2,3,2) | # mobile Orange Madagascar
|
|
530
522
|
match(/\A(33)\d+\z/) >> split(2,3,2) | # mobile Airtel Madagascar
|
|
531
523
|
match(/\A(34)\d+\z/) >> split(2,3,2) | # mobile Telecom Malagasy (Telma)
|
|
524
|
+
match(/\A(37)\d+\z/) >> split(2,3,2) | # mobile Orange Madagascar
|
|
532
525
|
match(/\A(38)\d+\z/) >> split(2,3,2) | # mobile Telecom Malagasy (Telma)
|
|
533
526
|
match(/\A(39)\d+\z/) >> split(2,3,2) # mobile Blueline Madagascar
|
|
534
527
|
|
|
@@ -654,12 +647,12 @@ Phony.define do
|
|
|
654
647
|
match(/^(2[467]\d{2})\d{4}$/) >> split(2,2) | # 4-digit NDC
|
|
655
648
|
match(/^(6\d[18])\d+$/) >> split(3,3) | # mobile
|
|
656
649
|
match(/^(60\d{2})\d{8}$/) >> split(2,2,2,2) | # mobile machine to machine
|
|
657
|
-
match(/^((2[^467]|[
|
|
658
|
-
match(/^((2[^467]|[
|
|
659
|
-
match(/^((2[^467]|[
|
|
660
|
-
match(/^((2[^467]|[
|
|
661
|
-
match(/^((2[^467]|[
|
|
662
|
-
match(/^((2[^467]|[
|
|
650
|
+
match(/^((2[^467]|[2-9]\d))\d{4}$/) >> split(2,2) | # 2-digit NDC Regular 6 digits number
|
|
651
|
+
match(/^((2[^467]|[2-9]\d))\d{4}$/) >> split(2,2) | # 2-digit NDC Regular 6 digits number
|
|
652
|
+
match(/^((2[^467]|[2-9]\d))\d{5}$/) >> split(2,2,1) | # 2-digit NDC Regular 6 digits number w/ 1 digit extension
|
|
653
|
+
match(/^((2[^467]|[2-9]\d))\d{6}$/) >> split(2,2,2) | # 2-digit NDC Regular 8 digits number or 6 digits with 2 digits extension
|
|
654
|
+
match(/^((2[^467]|[2-9]\d))\d{7}$/) >> split(2,2,3) | # 2-digit NDC Regular 6 digits with 4 digits extension
|
|
655
|
+
match(/^((2[^467]|[2-9]\d))\d{8}$/) >> split(2,2,4) | # 2-digit NDC Regular 6 digits number with 4 digits extension
|
|
663
656
|
match(/^(\d{2})\d{3}$/) >> split(2,2,1) # fallback for 5 digit number
|
|
664
657
|
|
|
665
658
|
# country '353' # Republic of Ireland, see special file.
|
|
@@ -528,6 +528,8 @@ describe 'country descriptions' do
|
|
|
528
528
|
it_splits '352545258', ['352', '54', '52', '58']
|
|
529
529
|
it_splits '352818181', ['352', '81', '81', '81']
|
|
530
530
|
it_splits '3523572141', ['352', '35', '72', '14', '1']
|
|
531
|
+
it_splits '3522634731', ['352', '26', '34', '73', '1']
|
|
532
|
+
it_splits '352264412701', ['352', '26', '44', '12', '701']
|
|
531
533
|
end
|
|
532
534
|
describe 'Macedonia' do
|
|
533
535
|
it_splits '38921234567', ['389', '2', '123', '4567'] # Skopje
|
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.
|
|
4
|
+
version: 2.20.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Hanke
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-08-13 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
|