phony 2.20.4 → 2.20.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +1 -1
- data/lib/phony/countries.rb +18 -2
- data/spec/functional/plausibility_spec.rb +2 -1
- data/spec/lib/phony/countries_spec.rb +6 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68617b6bf80b10f9dbd64feb4f49ddab596b15b764fd61055879463dd06c5718
|
4
|
+
data.tar.gz: 5baed629ebf5d0d5a41f2591b69b96b0626e43fe9a4f5f1ee1db5dc4cd16dd61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a91e3ec9440a6ac196dc558ec872b05f595d4b8907f50ad6ef42b23b5fb1f772aaf5a6a330e7f03e003b02df12115774d7f91eba7148e639e2d96f95816526c
|
7
|
+
data.tar.gz: f7e0faa6c2372c54920dc7405e78c0635884f373775141375d8254df612026b5571a86b19011e475405260d2b498b465e6a583e6c9f0b0aeb4856c4f57af3a52
|
data/README.textile
CHANGED
@@ -104,7 +104,7 @@ For example, when just loading the NANP CC, the retained memory usage is ~63kB.
|
|
104
104
|
|
105
105
|
h2. List of Handled Countries
|
106
106
|
|
107
|
-
Mildly unmaintained list: Abhas, Afghan, Algerian, Argentina, Austrian, Australian, Azerbaijani, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, El Salvadorian, Estonian, French, German, Ghanan, Gibraltar, Greek, Haiti, Hong Kong, Hungarian, Indian, Iran, Irish, Israel, Italian, Japanese, Kazakh, Liberian, Lithuanian, Luxembourgian, Malaysian, Malta, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Seychelles, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sri Lankan, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, Vietnamese, and Zambian numbers.
|
107
|
+
Mildly unmaintained list: Abhas, Afghan, Algerian, Argentina, Austrian, Australian, Azerbaijani, Belgian, Brazilian, Cambodian, Chilean, Chinese, Croatian, Cuban, Cypriot, Czech, Danish, Dutch, Egyptian, El Salvadorian, Estonian, French, German, Ghanan, Gibraltar, Greek, Haiti, Hong Kong, Hungarian, Indian, Iran, Irish, Israel, Italian, Japanese, Kazakh, Liberian, Lithuanian, Luxembourgian, Malaysian, Malta, Mauritian, Mexican, Monaco, Morocco, New Zealand, Nigerian, Norwegian, Peruvian, Polish, Romanian, Russian, Rwandan, Seychelles, Singapore, Slovakian, South African, South Korean, South Osetian, Spanish, Sri Lankan, Sudan, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, Venezuelan, Vietnamese, and Zambian numbers.
|
108
108
|
|
109
109
|
h2. Proud Sponsors
|
110
110
|
|
data/lib/phony/countries.rb
CHANGED
@@ -376,7 +376,16 @@ Phony.define do
|
|
376
376
|
country '228', none >> split(4,4) # Togolese Republic http://www.wtng.info/wtng-228-tg.html
|
377
377
|
country '229', none >> split(4,4) # Benin http://www.itu.int/oth/T0202000017/en
|
378
378
|
|
379
|
-
|
379
|
+
# Mauritius
|
380
|
+
# http://www.wtng.info/wtng-230-mu.html
|
381
|
+
# https://en.wikipedia.org/wiki/Telephone_numbers_in_Mauritius
|
382
|
+
#
|
383
|
+
# There is no trunk code for this country.
|
384
|
+
country '230',
|
385
|
+
none >> matched_split(
|
386
|
+
/^5\d{7}$/ => [1,3,4], # Mobile
|
387
|
+
/^[246]\d{6}$/ => [3,4], # Landline
|
388
|
+
)
|
380
389
|
|
381
390
|
# Liberia
|
382
391
|
# https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=LR
|
@@ -920,7 +929,14 @@ Phony.define do
|
|
920
929
|
)
|
921
930
|
|
922
931
|
country '671', todo # Spare code
|
923
|
-
|
932
|
+
|
933
|
+
# Australian External Territories https://en.wikipedia.org/wiki/Telephone_numbers_in_Norfolk_Island
|
934
|
+
# Norfolk Island
|
935
|
+
country '672',
|
936
|
+
fixed(1) >> split(2,3) |
|
937
|
+
match(/^(2\d+)$/) >> split(3) | # Fixed
|
938
|
+
match(/^(5\d+)$/) >> split(3) # Mobile
|
939
|
+
|
924
940
|
country '673', fixed(1) >> split(3, 3) # Brunei Darussalam http://www.wtng.info/wtng-673-bn.html
|
925
941
|
country '674', none >> split(3, 4) # Nauru (Republic of) http://www.wtng.info/wtng-674-nr.html
|
926
942
|
|
@@ -355,7 +355,8 @@ describe 'plausibility' do
|
|
355
355
|
it_is_correct_for 'Marshall Islands (Republic of the)', :samples => '+692 372 7183'
|
356
356
|
it_is_correct_for 'Martinique (French Department of)', :samples => '+596 596 123 456'
|
357
357
|
it_is_correct_for 'Mauritania', :samples => '+222 1234 5678'
|
358
|
-
it_is_correct_for 'Mauritius', :samples => '+230
|
358
|
+
it_is_correct_for 'Mauritius', :samples => ['+230 5 695 2277',
|
359
|
+
'+230 260 0070']
|
359
360
|
it_is_correct_for 'Micronesia (Federated States of)', :samples => '+691 766 7914'
|
360
361
|
it_is_correct_for 'Moldova', :samples => ['+373 800 123 45',
|
361
362
|
'+373 22 123 345',
|
@@ -593,6 +593,10 @@ describe 'country descriptions' do
|
|
593
593
|
it_splits '31222123456', ['31', '222', '123', '456']
|
594
594
|
it_splits '3197012345678', ['31', '970', '1234', '5678'] # machine-to-machine
|
595
595
|
end
|
596
|
+
describe 'Norfolk Island' do
|
597
|
+
it_splits '672321234', ['672', '3', '21', '234'] # fixed
|
598
|
+
it_splits '672351234', ['672', '3', '51', '234'] # mobile
|
599
|
+
end
|
596
600
|
describe 'Norway' do
|
597
601
|
it_splits '4721234567', ['47',false,'21','23','45','67']
|
598
602
|
it_splits '4731234567', ['47',false,'31','23','45','67']
|
@@ -1086,7 +1090,8 @@ describe 'country descriptions' do
|
|
1086
1090
|
it_splits '22212345678', ['222', false, '1234', '5678']
|
1087
1091
|
end
|
1088
1092
|
describe 'Mauritius' do
|
1089
|
-
it_splits '23059518919', ['230', false, '
|
1093
|
+
it_splits '23059518919', ['230', false, '5', '951', '8919']
|
1094
|
+
it_splits '2302600070', ['230', false, '260', '0070']
|
1090
1095
|
end
|
1091
1096
|
describe 'Micronesia (Federated States of)' do
|
1092
1097
|
it_splits '6911991754', ['691', false, '199', '1754']
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-07 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
|
@@ -115,26 +115,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.4.14
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Fast international phone number (E164 standard) normalizing, splitting and
|
122
122
|
formatting.
|
123
123
|
test_files:
|
124
|
-
- spec/
|
125
|
-
- spec/
|
126
|
-
- spec/lib/phony/country_spec.rb
|
127
|
-
- spec/lib/phony/national_code_spec.rb
|
124
|
+
- spec/functional/config_spec.rb
|
125
|
+
- spec/functional/plausibility_spec.rb
|
128
126
|
- spec/lib/phony/countries_spec.rb
|
127
|
+
- spec/lib/phony/country_codes_spec.rb
|
128
|
+
- spec/lib/phony/country_spec.rb
|
129
129
|
- spec/lib/phony/dsl_spec.rb
|
130
|
-
- spec/lib/phony/
|
130
|
+
- spec/lib/phony/local_splitters/fixed_spec.rb
|
131
|
+
- spec/lib/phony/local_splitters/regex_spec.rb
|
132
|
+
- spec/lib/phony/national_code_spec.rb
|
133
|
+
- spec/lib/phony/national_splitters/default_spec.rb
|
134
|
+
- spec/lib/phony/national_splitters/fixed_spec.rb
|
131
135
|
- spec/lib/phony/national_splitters/none_spec.rb
|
132
136
|
- spec/lib/phony/national_splitters/regex_spec.rb
|
133
|
-
- spec/lib/phony/national_splitters/
|
134
|
-
- spec/lib/phony/
|
135
|
-
- spec/lib/phony/country_codes_spec.rb
|
136
|
-
- spec/lib/phony/local_splitters/regex_spec.rb
|
137
|
-
- spec/lib/phony/local_splitters/fixed_spec.rb
|
137
|
+
- spec/lib/phony/national_splitters/variable_spec.rb
|
138
|
+
- spec/lib/phony/trunk_code_spec.rb
|
138
139
|
- spec/lib/phony/vanity_spec.rb
|
139
|
-
- spec/
|
140
|
-
- spec/functional/plausibility_spec.rb
|
140
|
+
- spec/lib/phony_spec.rb
|