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 +4 -4
- data/lib/phony/countries/vietnam.rb +88 -97
- data/spec/lib/phony/countries_spec.rb +3 -1
- 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: d38b915eda6ff2cd980e7e0798226cecf8300ccbeef6e17fc1ea661789f52a39
|
4
|
+
data.tar.gz: 323aef3ea753f47f6d837848e687a16b268436bb2e7d90cd0b872843a69e8e0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
'
|
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
|
-
'
|
15
|
-
'
|
16
|
-
'
|
17
|
-
'
|
18
|
-
'
|
19
|
-
'
|
20
|
-
'
|
21
|
-
'
|
22
|
-
'
|
23
|
-
'
|
24
|
-
'
|
25
|
-
'
|
26
|
-
'
|
27
|
-
|
28
|
-
'
|
29
|
-
'
|
30
|
-
'
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
'
|
35
|
-
'
|
36
|
-
'
|
37
|
-
'
|
38
|
-
'
|
39
|
-
|
40
|
-
'
|
41
|
-
'
|
42
|
-
'
|
43
|
-
'
|
44
|
-
'
|
45
|
-
'
|
46
|
-
'
|
47
|
-
'
|
48
|
-
'
|
49
|
-
'
|
50
|
-
'
|
51
|
-
'
|
52
|
-
|
53
|
-
'
|
54
|
-
'
|
55
|
-
'
|
56
|
-
'
|
57
|
-
'
|
58
|
-
'
|
59
|
-
'
|
60
|
-
'
|
61
|
-
'
|
62
|
-
'
|
63
|
-
|
64
|
-
'
|
65
|
-
'
|
66
|
-
'
|
67
|
-
'
|
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', # Hà 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', # Hà 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', # Hà Tĩnh Province
|
43
|
+
'24', # Hà Nội Province
|
44
|
+
'251', # Đồng Nai Province
|
45
|
+
'252', # Bình Thuận Province
|
46
|
+
'254', # Bà 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', # Cà 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
|
-
'
|
85
|
-
'
|
86
|
-
'
|
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 '
|
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.
|
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
|
+
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
|