phony 2.14.14 → 2.14.15

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
  SHA1:
3
- metadata.gz: 683068d6331958dc5cb1d1c5d332b3039fbf3f81
4
- data.tar.gz: 2c6306ef503912536c994a9b925e6623bda6c543
3
+ metadata.gz: f7db3aeb99e0674a7c0de8b180676e1f10bad279
4
+ data.tar.gz: 0c59b56cf1d684fb1a5dc25ac177937ca88bef29
5
5
  SHA512:
6
- metadata.gz: 244939128dc71e8fc7e93090e031736ccbbcbebc91f9abfad8ddc0585216ff65ca3e522c20a3eda7cfa4eb9984d147fa2065a64343df9f874fbcdff75c6f4dce
7
- data.tar.gz: 35449d828f7b060045a804bd76e33c027dca913955f78846241acec9b0d4a597c81c2a0f4192954f090f06890202cf0b6025a650016cb6b7544ba0660963b840
6
+ metadata.gz: aa44c9f91eaa2ed5dcb7112cfedeade05a59f997b9a5b33a6dc4caa2d34b55fb9e8d54714bd9535855f5eb3d84340049f917f72de57f94a15def800938690c1f
7
+ data.tar.gz: 7e4585f2586db0f919418708410230cd9ebfa1bc6868a490cd6ef7e215a4023e04f9ce70c9773e78b23671a40a41c7ccc85ab1d5b834f2511d5f1083aa8a387b
data/lib/phony.rb CHANGED
@@ -41,6 +41,7 @@ require File.expand_path '../phony/countries/libya', __FILE__
41
41
  require File.expand_path '../phony/countries/malaysia', __FILE__
42
42
  require File.expand_path '../phony/countries/moldova', __FILE__
43
43
  require File.expand_path '../phony/countries/montenegro', __FILE__
44
+ require File.expand_path '../phony/countries/myanmar', __FILE__
44
45
  require File.expand_path '../phony/countries/namibia', __FILE__
45
46
  require File.expand_path '../phony/countries/nepal', __FILE__
46
47
  require File.expand_path '../phony/countries/netherlands', __FILE__
@@ -302,7 +302,7 @@ Phony.define do
302
302
  country '94', # TODO Sri Lanka (Democratic Socialist Republic of)
303
303
  fixed(2) >> split(3,2,2)
304
304
 
305
- country '95', trunk('0') | fixed(2) >> split(3,2,2) # TODO Myanmar (Union of)
305
+ #country '95' # Myanmar, see special file.
306
306
 
307
307
  country '98', # Iran (Islamic Republic of)
308
308
  one_of('21') >> split(4,4) | # Teheran
@@ -0,0 +1,53 @@
1
+ # Myanmar: http://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000920003PDFE.pdf
2
+ #
3
+ # formatting according to Google's libphonenumber library. (r680 7/30/2014)
4
+ # except for ANEE SAKHAN area, Yangon ZTE GSM, MEC Tel CDMA 800 Mhz which are
5
+ # not correctly handled by the google library
6
+
7
+ area_codes = [
8
+ '1',
9
+ '2',
10
+ '42',
11
+ '43',
12
+ '44',
13
+ '45',
14
+ '46',
15
+ '52',
16
+ '53',
17
+ '54',
18
+ '57',
19
+ '58',
20
+ '59',
21
+ '61',
22
+ '62',
23
+ '64',
24
+ '65',
25
+ '66',
26
+ '67',
27
+ '69',
28
+ '70',
29
+ '71',
30
+ '72',
31
+ '73',
32
+ '75',
33
+ '81',
34
+ '82',
35
+ '83',
36
+ '84',
37
+ '85',
38
+ '86'
39
+ ]
40
+
41
+ Phony.define do
42
+ country '95',
43
+ one_of(area_codes) >> matched_split(
44
+ /\A\d{5}\z/ => [2,3],
45
+ /\A\d{6}\z/ => [3,3],
46
+ /\A\d{7}\z/ => [3,4]
47
+ ) |
48
+ one_of('9') >> matched_split( # mobile operators
49
+ /\A\d{7}\z/ => [3,4],
50
+ /\A\d{8}\z/ => [4,4],
51
+ /\A\d{9}\z/ => [3,3,3]
52
+ )
53
+ 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.14
4
+ version: 2.14.15
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-08-15 00:00:00.000000000 Z
11
+ date: 2015-09-04 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
@@ -43,6 +43,7 @@ files:
43
43
  - lib/phony/countries/malaysia.rb
44
44
  - lib/phony/countries/moldova.rb
45
45
  - lib/phony/countries/montenegro.rb
46
+ - lib/phony/countries/myanmar.rb
46
47
  - lib/phony/countries/namibia.rb
47
48
  - lib/phony/countries/nepal.rb
48
49
  - lib/phony/countries/netherlands.rb