phony 2.19.8 → 2.19.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0fc7753788d596736d26fddf4ff8688d33348e45512f3edea923b8fb35afa7c
4
- data.tar.gz: 570d9d1012de2b6a854bafc238e385619365b4a559cea14f321ded2f0644c851
3
+ metadata.gz: d971b51de8e8d0581c884f90238d00bbdeeee7ca248ae3b93ce75e5b759114fd
4
+ data.tar.gz: d37f03c8ca22a2fcf76b046a38cfd6cc6334d79cd377bb221e1610352b331ee7
5
5
  SHA512:
6
- metadata.gz: b22cf9c9b8bffe3222333461c919b5a04fab9b4d7f111c0679b79e602787a262b0716a432affa4b1a35710ab26e188f947420dcf35a7b893ae7af22e58d0e4c5
7
- data.tar.gz: '008fcad42c6dec3854a15b6dfe9d4856b5a26950cd8a9bfa4495d056159dd0dc9b3e77320380e97350fd7d6ec7886af542c6435da21771c12889f82cbac6a962'
6
+ metadata.gz: '028169288dfdcd908210a144add1c6d6eb082703602fd4eaa069c9ca952fe8e3e8c0c46764244af569cf90ba5fb535681369b700e3f273bebde591c534e544d3'
7
+ data.tar.gz: dc281117fa228352a099b3dc28e77d13c7d8145ef93f50ab721817e6b0a6024a32e4f4587c191529142ba987498b62d9a1bd3b9c4cfbf3ae72f2537b70e375ab
@@ -280,6 +280,7 @@ Phony.define do
280
280
  /^[^1]\d{6}$/ => [7]
281
281
  ) |
282
282
  one_of(*ndcs_4digit) >> matched_split(
283
+ /\A\d{4}\z/ => [4],
283
284
  /^1\d{5}$/ => [6],
284
285
  /^1\d{6}$/ => [7],
285
286
  /^[^1]\d{4}$/ => [5],
@@ -111,6 +111,6 @@ Phony.define do
111
111
  one_of(ndcs_with_5_subscriber_numbers) >> split(3,2) |
112
112
  one_of(ndcs_with_6_subscriber_numbers) >> split(3,3) |
113
113
  one_of(ndcs_with_7_subscriber_numbers) >> split(4,3) |
114
- one_of(%w(91 92)) >> split(4,3) | # mobile
114
+ one_of(%w(91 92 94 95)) >> split(4,3) | # mobile
115
115
  fixed(2) >> split(3,3)
116
116
  end
@@ -96,15 +96,16 @@ Phony.define do
96
96
  # Belgium.
97
97
  #
98
98
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Belgium
99
+ # https://www.bipt.be/operators/publication/national-numbering-plan
99
100
  #
100
101
  country '32', trunk('0') |
101
- match(/^(7[08])\d+$/) >> split(3,3) | # Premium and national rate Services
102
- match(/^(800|90\d)\d+$/) >> split(2,3) | # Toll free service and premium numbers
103
- match(/^(46[05678])\d{6}$/) >> split(2,2,2) | # Mobile (Lycamobile, Telenet, Join Experience, Proximus 0460)
104
- match(/^(4[789]\d)\d{6}$/) >> split(2,2,2) | # Mobile
105
- match(/^(45[56])\d{6}$/) >> split(2,2,2) | # Mobile Vikings and Voo
106
- one_of('2','3','4','9') >> split(3,2,2) | # Short NDCs
107
- fixed(2) >> split(2,2,2) # 2-digit NDCs
102
+ match(/^(7[08])\d+$/) >> split(3,3) | # Premium and national rate Services
103
+ match(/^(800|90\d)\d+$/) >> split(2,3) | # Toll free service and premium numbers
104
+ match(/^(46[056789])\d{6}$/) >> split(2,2,2) | # Mobile (Lycamobile, Telenet, Join Experience, Proximus 0460)
105
+ match(/^(4[789]\d)\d{6}$/) >> split(2,2,2) | # Mobile
106
+ match(/^(45[56])\d{6}$/) >> split(2,2,2) | # Mobile Vikings and Voo
107
+ one_of('2','3','4','9') >> split(3,2,2) | # Short NDCs
108
+ fixed(2) >> split(2,2,2) # 2-digit NDCs
108
109
 
109
110
  # France.
110
111
  #
@@ -976,7 +977,7 @@ Phony.define do
976
977
  /\A800\d+\z/ => [3,3], # freephone
977
978
  /\A830\d+\z/ => [3,3], # shared cost
978
979
  /\A60\d+\z/ => [3,3], # wireless geographic
979
- /\A(72|75|76|77)\d+\z/ => [3,4], # mobile
980
+ /\A(71|72|75|76|77)\d+\z/ => [3,4], # mobile
980
981
  /\A84\d+\z/ => [3,4], # wireless geographic
981
982
  /\A\d+\z/ => [2,3] # geographic
982
983
  )
@@ -280,6 +280,7 @@ describe 'plausibility' do
280
280
  it_is_correct_for 'Guinea-Bissau', :samples => '+245 44 728 6998'
281
281
  it_is_correct_for 'Guyana', :samples => '+592 263 1234'
282
282
  it_is_correct_for 'Honduras (Republic of)', :samples => '+504 12 961 637'
283
+ it_is_correct_for 'Italy', :samples => ['+39 0574 1234']
283
284
  it_is_correct_for 'Iraq', :samples => ['+964 1 123 4567',
284
285
  '+964 21 113 456',
285
286
  '+964 71 1234 5678']
@@ -516,7 +517,10 @@ describe 'plausibility' do
516
517
  it_is_correct_for 'Lybia', :samples => ['+218 205 123 45',
517
518
  '+218 22 123 456',
518
519
  '+218 21 1234 456',
519
- '+218 91 1234 456']
520
+ '+218 91 1234 456',
521
+ '+218 92 1234 456',
522
+ '+218 94 1234 456',
523
+ '+218 95 1234 456']
520
524
  it_is_correct_for 'Mongolia', :samples => ['+976 11 123 45',
521
525
  ['+976 121 12 34', '+976 121 12 345'],
522
526
  '+976 70 123 456',
@@ -110,6 +110,7 @@ describe 'country descriptions' do
110
110
  it_splits '32466123456', ['32', '466', '12', '34', '56'] # mobile (Vectone)
111
111
  it_splits '32467123456', ['32', '467', '12', '34', '56'] # mobile (Telenet)
112
112
  it_splits '32468123456', ['32', '468', '12', '34', '56'] # mobile (Telenet)
113
+ it_splits '32469123456', ['32', '469', '12', '34', '56'] # mobile ()
113
114
  it_splits '32475123456', ['32', '475', '12', '34', '56'] # mobile (Proximus)
114
115
  it_splits '32485123456', ['32', '485', '12', '34', '56'] # mobile (Telenet)
115
116
  it_splits '32495123456', ['32', '495', '12', '34', '56'] # mobile (Orange)
@@ -469,6 +470,7 @@ describe 'country descriptions' do
469
470
  it_splits '3903123391', ['39', '031', '23391'] # Como
470
471
  it_splits '390909709511', ['39', '090', '9709511'] # Barcellona
471
472
  it_splits '390471811353', ['39', '0471', '811', '353'] # Bolzano
473
+ it_splits '3905745730', ['39', '0574', '5730'] # Prato
472
474
  end
473
475
  describe 'Japan' do
474
476
  it_splits '81312345678', %w(81 3 1234 5678) # Tokyo
@@ -1051,6 +1053,8 @@ describe 'country descriptions' do
1051
1053
  it_splits '21822123456', %w(218 22 123 456)
1052
1054
  it_splits '218211234456', %w(218 21 1234 456)
1053
1055
  it_splits '218911234456', %w(218 91 1234 456)
1056
+ it_splits '218941234456', %w(218 94 1234 456)
1057
+ it_splits '218951234456', %w(218 95 1234 456)
1054
1058
  end
1055
1059
  describe 'Madagascar' do
1056
1060
  it_splits '261202254716', ['261', '20', *%w(22 547 16)]
@@ -1231,6 +1235,7 @@ describe 'country descriptions' do
1231
1235
  describe 'Samoa (Independent State of)' do
1232
1236
  it_splits '685800123', ['685', false, '800', '123']
1233
1237
  it_splits '68561123', ['685', false, '61', '123']
1238
+ it_splits '6857112345', ['685', false, '711', '2345']
1234
1239
  it_splits '6857212345', ['685', false, '721', '2345']
1235
1240
  it_splits '685830123', ['685', false, '830', '123']
1236
1241
  it_splits '685601234', ['685', false, '601', '234']
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.19.8
4
+ version: 2.19.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-04-21 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