phony 1.8.6 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -185,7 +185,15 @@ Phony.define do
185
185
  match(/^(4\d\d)\d+$/) >> split(3,3) | # Mobile
186
186
  fixed(1) >> split(4,4) # Rest
187
187
 
188
- country '62', todo # TODO Indonesia (Republic of)
188
+ # Indonesia (Republic of)
189
+ country '62',
190
+ one_of('21','22','24','31') >> split(7) |
191
+ one_of('21','22','24','31') >> split(8) |
192
+ fixed(3) >> split(5) |
193
+ fixed(3) >> split(6) |
194
+ fixed(3) >> split(7) |
195
+ fixed(3) >> split(8)
196
+
189
197
  country '63', todo # TODO Philippines (Republic of the)
190
198
 
191
199
  # New Zealand.
@@ -148,6 +148,11 @@ describe 'country descriptions' do
148
148
  it_splits '3544621234', ['354', false, '462', '1234'] # Akureyri
149
149
  it_splits '3545511234', ['354', false, '551', '1234'] # Reykjavík
150
150
  end
151
+ describe 'Indonesia' do
152
+ it_splits '6242323032', ['62', '423', '23032']
153
+ it_splits '6285220119289', ['62', '852', '20119289']
154
+ it_splits '62217815263', ['62', '21', '7815263']
155
+ end
151
156
  describe 'Ireland' do
152
157
  it_splits '35311234567', ['353', '1', '123', '4567'] # Dublin, 7 digit subscriber #
153
158
  it_splits '3532212345', ['353', '22', '12345'] # Mallow, 5 digit subscriber #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Fast international phone number (E164 standard) normalizing, splitting
15
15
  and formatting. Lots of formatting options: International (+.., 00..), national