phony 2.16.8 → 2.16.9

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: 4fcfad955fe11d9891d6792403f549144e6baf3d6e88e7195afba3edd19dd924
4
- data.tar.gz: b73d6f61b64658986c047e04f7ce0a8d5560eb0d86cfe2f9b0a2b04a99bb0555
3
+ metadata.gz: d38b915eda6ff2cd980e7e0798226cecf8300ccbeef6e17fc1ea661789f52a39
4
+ data.tar.gz: 323aef3ea753f47f6d837848e687a16b268436bb2e7d90cd0b872843a69e8e0b
5
5
  SHA512:
6
- metadata.gz: ea1b991f593d92fbd37da9ed19c8352159337c929a00bb474e64092a0e0799348a2342c870296f6d810150faaa6cbd337405df15f4f1afbd532328e91813b089
7
- data.tar.gz: 2d1909f437e133f966b30ccc9ddb9bdf99a967ccd3cc63c002566eb1ab6a0044bc9413b14eaff3e6b5368692f102fc88cf653a016c1225ee9aac4d4373c3eb64
6
+ metadata.gz: 795dbdd921029b92dde8a670b386a1747444f83733a55e1afadcd9ddb905d0df2dd709bbb64adc631088c0c68a8acecad674ad782262afafe9551f6be80707ce
7
+ data.tar.gz: 88f58ad9e30340b55992a19b776654d4c3ee2961925666821578813999f63093ecbec0bf0a345cabdecf64e98fa4bd571848e40c0b95160a1c48926b8c6c03bd
@@ -8,124 +8,115 @@
8
8
  #
9
9
 
10
10
  ndcs_with_7_subscriber_digits = [
11
- '20', # Lào Cai Province
11
+ '203', # Quảng Ninh Province
12
+ '204', # Bắc Giang (From 15 April 2017)
13
+ '205', # Lạng Sơn Province
14
+ '206', # Cao Bằng Province
15
+ '207', # Tuyên Quang Province
16
+ '208', # Thái Nguyên Provine
17
+ '209', # Bắc Kạn Province
12
18
  '210', # Phú Thọ Province
13
19
  '211', # Vĩnh Phúc Province
14
- '218', # Hòa Bình Province (18 before 24 Nov 2007)
15
- '219', # Giang Province (19 before 24 Nov 2007)
16
- '22', # Sơn La Province
17
- '230', # Điện Biên Province (23 before 24 Nov 2007)
18
- '231', # Lai Châu Province (23 before 24 Nov 2007)
19
- '240', # Bắc Giang Province
20
- '241', # Bắc Ninh Province
21
- '25', # Lạng Sơn Province
22
- '26', # Cao Bằng Province
23
- '27', # Tuyên Quang Province
24
- '280', # Thái Nguyên Province
25
- '281', # Bắc Kạn Province
26
- '29', # Yên Bái Province
27
-
28
- '30', # Ninh Bình Province
29
- '31', # Hai Phong city
30
- '320', # Hải Dương Province
31
- '321', # Hưng Yên Province
32
- '33', # Quảng Ninh Province
33
- '350', # Nam Định Province
34
- '351', # Nam Province
35
- '36', # Thái Bình Province
36
- '37', # Thanh Hóa Province
37
- '38', # Nghệ An Province
38
- '39', # Tĩnh Province
39
-
40
- '500', # Đắk Lắk Province (50 before 24 Nov 2007)
41
- '501', # Đắk Nông Province (50 before 24 Nov 2007)
42
- '510', # Quảng Nam Province
43
- '511', # Da Nang city
44
- '52', # Quảng Bình Province
45
- '53', # Quảng Trị Province
46
- '54', # Thừa Thiên–Huế Province
47
- '55', # Quảng Ngãi Province
48
- '56', # Bình Định Province
49
- '57', # Phú Yên Province
50
- '58', # Khánh Hòa Province
51
- '59', # Gia Lai Province
52
-
53
- '60', # Kon Tum Province
54
- '61', # Đồng Nai Province
55
- '62', # Bình Thuận Province
56
- '63', # Lâm Đồng Province
57
- '64', # Rịa–Vũng Tàu Province
58
- '650', # Bình Dương Province
59
- '651', # Bình Phước Province
60
- '66', # Tây Ninh Province
61
- '67', # Đồng Tháp Province
62
- '68', # Ninh Thuận Province
63
-
64
- '70', # Vĩnh Long Province
65
- '710', # Cần Thơ city (71 before 24 Nov 2007)
66
- '711', # Hậu Giang Province (71 before 24 Nov 2007)
67
- '72', # Long An Province
68
- '73', # Tiền Giang Province
69
- '74', # Trà Vinh Province
70
- '75', # Bến Tre Province
71
- '76', # An Giang Province
72
- '77', # Kiên Giang Province
73
- '780', # Cà Mau Province
74
- '781', # Bạc Liêu Province
75
- '79' # Sóc Trăng Province
76
- ]
77
-
78
- ndcs_with_8_subscriber_digits = [
79
- '4', # Hanoi
80
- '8' # Ho Chi Minh City
20
+ '212', # Sơn La Province
21
+ '213', # Lai Châu
22
+ '214', # Lào Cai Province
23
+ '215', # Điện Biên Province
24
+ '216', # Yên Bái Province
25
+ '218', # Hòa Bình Province
26
+ '219', # Giang Province
27
+ '220', # Hải Dương Province
28
+ '221', # Hưng Yên Province
29
+ '222', # Bắc Ninh Province
30
+ '225', # Hải Phòng Province
31
+ '226', # Nam Province
32
+ '227', # Thái Bình Province
33
+ '228', # Nam Định Province
34
+ '229', # Ninh Bình Province
35
+ '232', # Quảng Bình Province
36
+ '233', # Quảng Trị Province
37
+ '234', # Thừa Thiên Huế Province
38
+ '235', # Quảng Nam Province
39
+ '236', # Đà Nẵng Province
40
+ '237', # Thanh Hóa Province
41
+ '238', # Nghệ An Province
42
+ '239', # Tĩnh Province
43
+ '24', # Nội Province
44
+ '251', # Đồng Nai Province
45
+ '252', # Bình Thuận Province
46
+ '254', # Rịa Vũng Tàu Province
47
+ '255', # Quảng Ngãi Province
48
+ '256', # Bình Định Province
49
+ '257', # Phú Yên Province
50
+ '258', # Khánh Hòa Province
51
+ '259', # Ninh Thuận Province
52
+ '260', # Kon Tum Province
53
+ '261', # Đăk Nông Province
54
+ '262', # Đăk Lăk Province
55
+ '263', # Lâm Đồng Province
56
+ '269', # Gia Lai Province
57
+ '270', # Vĩnh Long Province
58
+ '271', # Bình Phước Province
59
+ '272', # Long An Province
60
+ '273', # Tiền Giang Province
61
+ '274', # Bình Dương Province
62
+ '275', # Bến Tre Province
63
+ '276', # Tây Ninh Province
64
+ '277', # Đồng Tháp Province
65
+ '28', # Hồ Chí Minh Province
66
+ '290', # Mau Province
67
+ '291', # Bạc Liêu Province
68
+ '292', # Cần Thơ Province
69
+ '293', # Hậu Giang Province
70
+ '294', # Trà Vinh Province
71
+ '296', # An Giang Province
72
+ '297', # Kiên Giang Province
73
+ '299', # Sóc Trăng Province
81
74
  ]
82
75
 
83
76
  mobile = [
84
- '86', # Viettel Mobile
85
- '88', # Vinaphone
86
- '89', # MobiFone
77
+ '32', # Viettel Mobile
78
+ '33', # Viettel Mobile
79
+ '34', # Viettel Mobile
80
+ '35', # Viettel Mobile
81
+ '36', # Viettel Mobile
82
+ '37', # Viettel Mobile
83
+ '38', # Viettel Mobile
84
+ '39', # Viettel Mobile
85
+ '52', # Vietnammobile
86
+ '56', # Vietnamobile
87
+ '58', # Vietnamobile (previously known as HT Mobile)
88
+ '59', # GTel (traded as Beeline)
89
+ '70', # MobiFone
90
+ '76', # MobiFone
91
+ '77', # MobiFone
92
+ '78', # MobiFone
93
+ '79', # MobiFone
94
+ '81', # Vinaphone
95
+ '82', # Vinaphone
96
+ '83', # Vinaphone
97
+ '84', # Vinaphone
98
+ '85', # Vinaphone
99
+ '86', # Viettel
100
+ '88', # Vinaphone
101
+ '89', # MobiFone,
87
102
  '90', # MobiFone
88
103
  '91', # Vinaphone
89
104
  '92', # Vietnamobile (previously known as HT Mobile)
90
105
  '93', # MobiFone
91
106
  '94', # Vinaphone
92
- '95', # S-Fone
93
107
  '96', # previously EVN Telecom, now Viettel Mobile
94
108
  '97', # Viettel Mobile
95
109
  '98', # Viettel Mobile
96
110
  '99', # Gmobile (traded as Beeline)
97
- '120', # MobiFone
98
- '121', # MobiFone
99
- '122', # MobiFone
100
- '123', # Vinaphone
101
- '124', # Vinaphone
102
- '125', # Vinaphone
103
- '126', # MobiFone
104
- '127', # Vinaphone
105
- '128', # MobiFone
106
- '129', # Vinaphone
107
- '162', # Viettel Mobile
108
- '163', # Viettel Mobile
109
- '164', # Viettel Mobile
110
- '165', # Viettel Mobile
111
- '166', # Viettel Mobile
112
- '167', # Viettel Mobile
113
- '168', # Viettel Mobile
114
- '169', # Viettel Mobile
115
- '186', # Vietnamobile
116
- '188', # Vietnamobile (previously known as HT Mobile)
117
- '199', # GTel (traded as Beeline)
118
- '868' # GTel (traded as Beeline)
119
111
  ]
120
112
 
121
- mobile_with_trunk = mobile.map{|num| "0#{num}" }
113
+ mobile_with_trunk = (mobile).map{|num| "0#{num}" }
122
114
 
123
115
  Phony.define do
124
116
  country '84',
125
117
  trunk('0') |
118
+ one_of(mobile) >> split(4..8)|
126
119
  one_of(ndcs_with_7_subscriber_digits) >> split(3,4) |
127
- one_of(ndcs_with_8_subscriber_digits) >> split(4,4) |
128
- one_of(mobile) >> split(5..8)|
129
120
  one_of(mobile_with_trunk) >> split(5..8)|
130
121
  # Govt reserved
131
122
  fixed(80) >> split(5) |
@@ -811,7 +811,9 @@ describe 'country descriptions' do
811
811
  describe 'Vietnam' do
812
812
  it_splits '8498123456', ['84', '98', '123456'] # Viettel Mobile
813
813
  it_splits '8499612345', ['84', '99', '612345'] # GTel
814
- it_splits '84412345678', ['84', '4', '1234', '5678'] # Hanoi
814
+ it_splits '84241234567', ['84', '24', '123', '4567'] # Hanoi
815
+ it_splits '84341234567', ['84', '34', '1234567'] # Viettel
816
+ it_splits '84841234567', ['84', '84', '1234567'] # Vinaphone
815
817
  end
816
818
  describe 'Zambia' do
817
819
  it_splits '260211123456', ['260', '211', '123456'] # Fixed
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.16.8
4
+ version: 2.16.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-12-15 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