phonie 3.1.2 → 3.1.3

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: 527ce1d22a7e15121f33f5ddecc17ccf8e21e38e
4
- data.tar.gz: 434942c59b9b14dbd71828baabe71c4fffaf7a8b
3
+ metadata.gz: 1eb8e80676a9158d38224c229ade58f55c1931a6
4
+ data.tar.gz: a2f2aa6df6ab0a9ba1cddd33f7e128dba083f484
5
5
  SHA512:
6
- metadata.gz: f79e53a3da180e9fb4ce04a1f3cc7c110e50901533c0553bfba5151ab041c85f108d7736cefbf16250168c462f8ac17813fc712591a1aa357389e211b5ab0862
7
- data.tar.gz: 72845e08eeadec2666c6177543e20d9220588f342001c71e785824875a49dcc277256ecf655208ae23e7f2a1610cf0d1d5ad39148c446e9f9fdeb9e8423c6f4e
6
+ metadata.gz: 5b20f47a10a9f15292aca92548cab3cc65a96154eb261453e194519b0d09aca9600adde3d6d902034fc2ee11c1ccb61502161cf0c983298569d84eef5f1b0817
7
+ data.tar.gz: b45fbe4d8f67fa9c1613bcee905c86921dce336dc45f75129f37b8c023e8e6778fe3d923ec74661da75d123eefee2c7d0f05c76b7993f88e0d9f8315fc6903d9
@@ -183,10 +183,10 @@
183
183
  :iso_3166_code: BR
184
184
  :name: Brazil
185
185
  :international_dialing_prefix: '00'
186
- :area_code: \d{2}
187
- :local_number_format: \d{7,8}
188
- :mobile_format: 11[6789]\d{7}
189
- :number_format: \d{10}
186
+ :area_code: '[1-9][1-9]'
187
+ :local_number_format: \d{7,9}
188
+ :mobile_format: '((1[1-9]|21|22|24|27|28)[6789]\d{8})|((23|2[5-9]|[3-9][1-9])[6789]\d{7})'
189
+ :number_format: \d{10,11}
190
190
  -
191
191
  :country_code: '253'
192
192
  :national_dialing_prefix: None
@@ -1,3 +1,3 @@
1
1
  module Phonie
2
- VERSION = '3.1.2'
2
+ VERSION = '3.1.3'
3
3
  end
@@ -4,9 +4,11 @@ require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
4
4
  class BRTest < Phonie::TestCase
5
5
  def test_local
6
6
  parse_test('+559112345678', '55', "91", '12345678', 'Brazil', false)
7
+ #parse_failure('+5591123456789') # only mobile numebrs can be 11 digits
7
8
  end
8
9
 
9
10
  def test_mobile
10
- parse_test('551161234567', '55', '11', '61234567', 'Brazil', true)
11
+ parse_test('553161234567', '55', '31', '61234567', 'Brazil', true)
12
+ parse_test('5512612345678', '55', '12', '612345678', 'Brazil', true)
11
13
  end
12
- end
14
+ end
data/test/test_helper.rb CHANGED
@@ -19,6 +19,11 @@ def parse_test(raw, country_code, area_code, number, country_name = nil, is_mobi
19
19
  end
20
20
  end
21
21
 
22
+ def parse_failure(raw)
23
+ pn = Phonie::Phone.parse!(raw)
24
+ assert_equal pn, nil
25
+ end
26
+
22
27
 
23
28
  class Phonie::TestCase < Test::Unit::TestCase
24
29
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonie
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Car
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-06-28 00:00:00.000000000 Z
15
+ date: 2014-06-30 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activemodel
@@ -231,8 +231,115 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  requirements: []
233
233
  rubyforge_project:
234
- rubygems_version: 2.2.2
234
+ rubygems_version: 2.2.0
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: Phone number parsing, validation and formatting
238
- test_files: []
238
+ test_files:
239
+ - test/countries/ae_test.rb
240
+ - test/countries/af_test.rb
241
+ - test/countries/al_test.rb
242
+ - test/countries/am_test.rb
243
+ - test/countries/ar_test.rb
244
+ - test/countries/at_test.rb
245
+ - test/countries/au_test.rb
246
+ - test/countries/az_test.rb
247
+ - test/countries/ba_test.rb
248
+ - test/countries/bd_test.rb
249
+ - test/countries/be_test.rb
250
+ - test/countries/bf_test.rb
251
+ - test/countries/bg_test.rb
252
+ - test/countries/bo_test.rb
253
+ - test/countries/br_test.rb
254
+ - test/countries/bs_test.rb
255
+ - test/countries/bt_test.rb
256
+ - test/countries/by_test.rb
257
+ - test/countries/bz_test.rb
258
+ - test/countries/ca_test.rb
259
+ - test/countries/ch_test.rb
260
+ - test/countries/cl_test.rb
261
+ - test/countries/cn_test.rb
262
+ - test/countries/co_test.rb
263
+ - test/countries/cr_test.rb
264
+ - test/countries/cy_test.rb
265
+ - test/countries/cz_test.rb
266
+ - test/countries/de_test.rb
267
+ - test/countries/dk_test.rb
268
+ - test/countries/dz_test.rb
269
+ - test/countries/ec_test.rb
270
+ - test/countries/ee_test.rb
271
+ - test/countries/eg_test.rb
272
+ - test/countries/es_test.rb
273
+ - test/countries/et_test.rb
274
+ - test/countries/fi_test.rb
275
+ - test/countries/fr_test.rb
276
+ - test/countries/gb_test.rb
277
+ - test/countries/ge_test.rb
278
+ - test/countries/gf_test.rb
279
+ - test/countries/gh_test.rb
280
+ - test/countries/gr_test.rb
281
+ - test/countries/gt_test.rb
282
+ - test/countries/gu_test.rb
283
+ - test/countries/gy_test.rb
284
+ - test/countries/hr_test.rb
285
+ - test/countries/ht_test.rb
286
+ - test/countries/hu_test.rb
287
+ - test/countries/ie_test.rb
288
+ - test/countries/il_test.rb
289
+ - test/countries/in_test.rb
290
+ - test/countries/iq_test.rb
291
+ - test/countries/ir_test.rb
292
+ - test/countries/is_test.rb
293
+ - test/countries/it_test.rb
294
+ - test/countries/jp_test.rb
295
+ - test/countries/ke_test.rb
296
+ - test/countries/kh_text.rb
297
+ - test/countries/km_test.rb
298
+ - test/countries/kr_test.rb
299
+ - test/countries/kw_test.rb
300
+ - test/countries/lk_test.rb
301
+ - test/countries/lt_test.rb
302
+ - test/countries/lu_test.rb
303
+ - test/countries/lv_test.rb
304
+ - test/countries/ma_test.rb
305
+ - test/countries/me_test.rb
306
+ - test/countries/mt_test.rb
307
+ - test/countries/mu_test.rb
308
+ - test/countries/mx_test.rb
309
+ - test/countries/ng_test.rb
310
+ - test/countries/ni_test.rb
311
+ - test/countries/nl_test.rb
312
+ - test/countries/no_test.rb
313
+ - test/countries/np_test.rb
314
+ - test/countries/nz_test.rb
315
+ - test/countries/ph_test.rb
316
+ - test/countries/pk_test.rb
317
+ - test/countries/pl_test.rb
318
+ - test/countries/pr_test.rb
319
+ - test/countries/pt_test.rb
320
+ - test/countries/qa_test.rb
321
+ - test/countries/ro_test.rb
322
+ - test/countries/rs_test.rb
323
+ - test/countries/ru_test.rb
324
+ - test/countries/sa_test.rb
325
+ - test/countries/se_test.rb
326
+ - test/countries/si_test.rb
327
+ - test/countries/sk_test.rb
328
+ - test/countries/sn_test.rb
329
+ - test/countries/sv_test.rb
330
+ - test/countries/th_test.rb
331
+ - test/countries/tn_test.rb
332
+ - test/countries/to_test.rb
333
+ - test/countries/tr_test.rb
334
+ - test/countries/tw_test.rb
335
+ - test/countries/ua_test.rb
336
+ - test/countries/us_test.rb
337
+ - test/countries/uy_test.rb
338
+ - test/countries/vn_test.rb
339
+ - test/countries/za_test.rb
340
+ - test/countries/zw_test.rb
341
+ - test/country_test.rb
342
+ - test/extension_test.rb
343
+ - test/phone_test.rb
344
+ - test/railties/validator_test.rb
345
+ - test/test_helper.rb