phony 2.20.5 → 2.20.7

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
  SHA256:
3
- metadata.gz: 443ce0ac52dcde0ab0b419d6c49123ac60fdb6525ce56df52c09102b2a1b79af
4
- data.tar.gz: 3db5d454a9c112ad429b1c0986379bae3230685bcc795aaedf5c0f7feba2a902
3
+ metadata.gz: dbab86defbfd8a5efb60e155549ca13d3809b11e1b28e1c6cd4c2d585fe1a1eb
4
+ data.tar.gz: 4092da2814cecda8fdec8f64f5eb91e566287cc9f4869653f469bd7664a26066
5
5
  SHA512:
6
- metadata.gz: c0081748a294e804a1e1870dc40bc9e4359733f25f54e73dbbf2ad7fd01661af91e6724fa550dc61a29f4ff0c2f3b2b9161160657c852493e63afbdc839f7ae7
7
- data.tar.gz: 0f371abf103cd53b85093973e96cbf3ae91d9d44b3e4e1b7db51826ce2a9f818252d9774cdd81abcdcf5f893dd696cf2649b70a0e7960164e8f02b4ca8618088
6
+ metadata.gz: 7602a49002ac077a26757f02540869f13b7145554e587f6980cff26ce99d566cd0c225ff34a8e51126069c34658375b1379fc174d0d2e224dc207ed1522ff6c9
7
+ data.tar.gz: fc0956c863ec0febe514aa0323f18efd23bc0022412b33522137484a48180090df207e7ae173d8f3ac86ee6082835e37c37262ef8b6c226ddfad433a9bc29599
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
 
@@ -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
- country '230', none >> split(4,4) # Mauritius http://www.wtng.info/wtng-230-mu.html
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
@@ -1070,6 +1079,7 @@ Phony.define do
1070
1079
 
1071
1080
  # Lao People's Democratic Republic http://www.wtng.info/wtng-856-la.html, https://www.numberingplans.com
1072
1081
  country '856',
1082
+ trunk('0') |
1073
1083
  one_of('30') >> split(3,4) | # geographic
1074
1084
  one_of('20') >> split(4,4) | # mobile
1075
1085
  fixed(2) >> split(3,3) # geographic
@@ -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 5695 2277'
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',
@@ -1090,7 +1090,8 @@ describe 'country descriptions' do
1090
1090
  it_splits '22212345678', ['222', false, '1234', '5678']
1091
1091
  end
1092
1092
  describe 'Mauritius' do
1093
- it_splits '23059518919', ['230', false, '5951', '8919']
1093
+ it_splits '23059518919', ['230', false, '5', '951', '8919']
1094
+ it_splits '2302600070', ['230', false, '260', '0070']
1094
1095
  end
1095
1096
  describe 'Micronesia (Federated States of)' do
1096
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.5
4
+ version: 2.20.7
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-05-06 00:00:00.000000000 Z
11
+ date: 2023-08-14 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.3.26
118
+ rubygems_version: 3.2.3
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/functional/config_spec.rb
125
- - spec/functional/plausibility_spec.rb
126
- - spec/lib/phony/countries_spec.rb
127
- - spec/lib/phony/country_codes_spec.rb
124
+ - spec/lib/phony_spec.rb
125
+ - spec/lib/phony/trunk_code_spec.rb
128
126
  - spec/lib/phony/country_spec.rb
129
- - spec/lib/phony/dsl_spec.rb
130
- - spec/lib/phony/local_splitters/fixed_spec.rb
131
- - spec/lib/phony/local_splitters/regex_spec.rb
132
127
  - 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
128
+ - spec/lib/phony/countries_spec.rb
129
+ - spec/lib/phony/dsl_spec.rb
130
+ - spec/lib/phony/national_splitters/variable_spec.rb
135
131
  - spec/lib/phony/national_splitters/none_spec.rb
136
132
  - spec/lib/phony/national_splitters/regex_spec.rb
137
- - spec/lib/phony/national_splitters/variable_spec.rb
138
- - spec/lib/phony/trunk_code_spec.rb
133
+ - spec/lib/phony/national_splitters/fixed_spec.rb
134
+ - spec/lib/phony/national_splitters/default_spec.rb
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
139
138
  - spec/lib/phony/vanity_spec.rb
140
- - spec/lib/phony_spec.rb
139
+ - spec/functional/config_spec.rb
140
+ - spec/functional/plausibility_spec.rb