phony 2.14.2 → 2.14.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/phony/countries/cambodia.rb +60 -27
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0397d5e261947d0331ec2fb7164e9838bd785534
4
- data.tar.gz: 386ad88c4cc8ded7c5d7635a336000c6666cb099
3
+ metadata.gz: cefb31abcc6e35e6d23212b756d008129f3b6163
4
+ data.tar.gz: db8fc173a095f55f81069fad6aebd4b13928bf23
5
5
  SHA512:
6
- metadata.gz: 1e97dba8ca0702c309138861c48af8b156408282509677579367458fe7335ac13d345e84ca17eab85d6c67dfb01447c1c7c08889f6026d82776f9651f6000565
7
- data.tar.gz: 32f74b1cfdd3d4301c1e60526cca67e5b0ee2b765c1230bf66e7a05dcf370d3d1a7afded3ce51587615115e61f3fda2183d3f67bccb781b94071b3e22812ece1
6
+ metadata.gz: c5d504bf4dcb20083053fb1b84659c1a6b70c7270d9dbe0cf4f1a75ebfd6ee7bb48a085d0772711b24b15adfc7fa62e40f24c9010e9e567aff2f56010b235368
7
+ data.tar.gz: 4e015f2dab7863d757dadc1b0829ea5fe13a7b391ab4b28d1604a658fde0b25c9a7b1e277aca3d33ba056f0511ec9a0ac35af40eb243f13bf0099bd64c0198a3
@@ -2,6 +2,8 @@
2
2
  # http://en.wikipedia.org/wiki/Telecommunications_in_Cambodia#Mobile_networks
3
3
  # http://en.wikipedia.org/wiki/Telephone_numbers_in_Cambodia
4
4
  # http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000230001MSWE.doc
5
+ # http://www.khmerdigitalpost.com/national-numbering-plans-in-cambodia-by-2014/
6
+ # http://www.khmerdigitalpost.com/mobile-operators-in-cambodia-by-2015/
5
7
 
6
8
  ndcs = [
7
9
  '23', # Phnom Penh
@@ -10,7 +12,7 @@ ndcs = [
10
12
  '26', # Kampong Chhnang
11
13
  '32', # Takeo
12
14
  '33', # Kampot
13
- '34', # Sihanoukville
15
+ '34', # Preah Sihanouk
14
16
  '35', # Koh Kong
15
17
  '36', # Kep
16
18
  '42', # Kampong Cham
@@ -31,40 +33,42 @@ ndcs = [
31
33
  ]
32
34
 
33
35
  six_digit_mobile_prefixes = [
34
- '60', # Beeline
35
- '66', # Beeline
36
- '67', # Beeline
37
- '68', # Beeline
38
- '90', # Beeline
36
+ '10', # Smart
39
37
  '11', # Mobitel
38
+ '12', # Mobitel
39
+ '13', # qb
40
+ '14', # Mobitel
41
+ '15', # Smart
42
+ '16', # Smart
40
43
  '17', # Mobitel
44
+ '18', # Excell
45
+ '60', # Metfone
41
46
  '61', # Mobitel
47
+ '66', # Metfone
48
+ '67', # Metfone
49
+ '68', # Metfone
50
+ '69', # Smart
51
+ '70', # Smart
42
52
  '77', # Mobitel
43
53
  '78', # Mobitel
44
- '85', # Mobitel
45
- '89', # Mobitel
46
- '92', # Mobitel
47
- '95', # Mobitel
48
- '99', # Mobitel
49
- '18', # Excell
50
- '13', # qb
51
54
  '80', # qb
55
+ '81', # Smart
52
56
  '83', # qb
53
57
  '84', # qb
54
- '10', # Smart
55
- '15', # Smart
56
- '16', # Smart
57
- '69', # Smart
58
- '70', # Smart
59
- '81', # Smart
58
+ '85', # Mobitel
60
59
  '86', # Smart
61
60
  '87', # Smart
61
+ '89', # Mobitel
62
+ '90', # Metfone
63
+ '92', # Mobitel
62
64
  '93', # Smart
65
+ '95', # Mobitel
63
66
  '98', # Smart
67
+ '99', # Mobitel
64
68
  ]
65
69
 
66
70
  seven_digit_mobile_prefixes = [
67
- '31', # Beeline
71
+ '31', # Metfone
68
72
  '38', # CooTel
69
73
  '71', # Metfone
70
74
  '76', # Mobitel
@@ -73,15 +77,44 @@ seven_digit_mobile_prefixes = [
73
77
  '97', # Metfone
74
78
  ]
75
79
 
76
- six_or_seven_digit_mobile_prefixes = [
77
- '12' # Mobitel
80
+ six_digit_total_single_digit_fixed_line_prefixes = [
81
+ '2', # Telecom Cambodia
82
+ '3', # Mobitel
83
+ '7', # Telecom Cambodia
84
+ '8', # Telecom Cambodia
85
+ '9', # Camintel
86
+ ]
87
+
88
+ six_digit_total_double_digit_fixed_line_prefixes = [
89
+ '40', # Telecom Cambodia
90
+ '41', # Telecom Cambodia
91
+ '42', # Telecom Cambodia
92
+ '43', # Telecom Cambodia
93
+ '44', # Telecom Cambodia
94
+ ]
95
+
96
+ seven_digit_total_single_digit_fixed_line_prefixes = [
97
+ '6', # Metfone
98
+ ]
99
+
100
+ seven_digit_total_double_digit_fixed_line_prefixes = [
101
+ '45', # Smart
102
+ '46', # Metfone
103
+ '47', # CooTel
104
+ '48', # Excell
105
+ '49', # qb
106
+ '50', # Mobitel
107
+ '51', # Mobitel
108
+ '52', # Mobitel
109
+ '53', # Mobitel
110
+ '54', # Mobitel
111
+ '55', # Mobitel
112
+ '56', # Smart
78
113
  ]
79
114
 
80
115
  Phony.define do
81
- country '855', trunk('0', :normalize => true) | one_of(six_digit_mobile_prefixes) >> matched_split(/^[1-9]/ => [3, 3]) |
116
+ country '855', trunk('0', :normalize => true) |
117
+ one_of(six_digit_mobile_prefixes) >> matched_split(/^[2-9]/ => [3, 3]) |
82
118
  one_of(seven_digit_mobile_prefixes) >> matched_split(/^[2-9]/ => [3, 4]) |
83
- one_of(six_or_seven_digit_mobile_prefixes) >> matched_split(
84
- /^[2-9]\d{5}$/ => [3, 3], /^[1-9]\d{6}$/ => [3, 4]
85
- ) |
86
- one_of(ndcs) >> matched_split(/^[2-9]\d{5}$/ => [3, 3], /^[2-9]\d{6}$/ => [3, 4])
119
+ one_of(ndcs) >> matched_split(/^(#{seven_digit_total_double_digit_fixed_line_prefixes.join('|')})\d{5}$/ => [3, 4], /^(#{seven_digit_total_single_digit_fixed_line_prefixes.join('|')})\d{6}$/ => [3, 4], /^(#{six_digit_total_double_digit_fixed_line_prefixes.join('|')})\d{4}$/ => [3, 3], /^(#{six_digit_total_single_digit_fixed_line_prefixes.join('|')})\d{5}$/ => [3, 3])
87
120
  end
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.14.2
4
+ version: 2.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-09 00:00:00.000000000 Z
11
+ date: 2015-06-12 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