phony 2.10.4 → 2.10.5

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: f8b1df19e2caa62c7221c2c41d71c84522d60bff
4
- data.tar.gz: cddd43f404e6a015974b3d4c6449509395073a70
3
+ metadata.gz: 125ff1e9d966b0683eeaa62003d8e16f6484b235
4
+ data.tar.gz: 4d13c383c23e7508bbdeb78940133a7f5ab431a3
5
5
  SHA512:
6
- metadata.gz: af34c18d8a74524c7a6c0aa4e64bdfce2edee04d50abd2505c765463244a909098652f97cdc0e91ec802644ac450b1254cf941137ed5288412ae9b534d32176f
7
- data.tar.gz: b5d4e2bbcbdea6c9a3854d421e0c6bc19e2bd3ab9ed6592f9a282a4ff29afc4562fb006a226065f7ceddd5c638fdfbdcbcfc9f7ff6222bfe3a719526469cd673
6
+ metadata.gz: 207cb0b24be71b884f8c1715367fc31d4d179170d885aa817963701475ec11b052213afd2e84863569b8fd5855223ce7d91d35aa7e489c28e3b8c54b2acaf427
7
+ data.tar.gz: 76e5420b85000cc96e691d83b8d23869198224523c098f812efc1a7dc9ead55c7e26b0491a8cac47418ad1a11c6dc4de1f4b6de9f887b1549dfac567982d99c3
@@ -340,11 +340,12 @@ Phony.define do
340
340
  # Nigeria
341
341
  # Wikipedia says 3 4 split, many local number with no splitting
342
342
  country '234',
343
- one_of('1', '2', '9') >> split(3,4) | # Lagos, Ibadan and Abuja
344
- match(/^(702\d)\d+$/) >> split(3,4) | # Mobile
345
- match(/^(70[3-9])\d+$/) >> split(3,4) | # Mobile
346
- match(/^(8[01]\d)\d+$/) >> split(3,4) | # Mobile
347
- fixed(2) >> split(3,4) # 2-digit NDC
343
+ match(/^(702\d)\d+$/) >> split(3,4) | # Mobile
344
+ match(/^(70[3-9])\d+$/) >> split(3,4) | # Mobile
345
+ match(/^(8[01]\d)\d+$/) >> split(3,4) | # Mobile
346
+ match(/^(90[2359])\d+$/) >> split(3,4) | # Mobile
347
+ one_of('1', '2', '9') >> split(3,4) | # Lagos, Ibadan and Abuja
348
+ fixed(2) >> split(3,4) # 2-digit NDC
348
349
 
349
350
  country '235', none >> split(4,4) # Chad http://www.wtng.info/wtng-235-td.html
350
351
  country '236', none >> split(4,4) # Central African Republic http://www.wtng.info/wtng-236-cf.html
@@ -80,7 +80,7 @@ module Phony
80
80
  # Splits this number into cc, ndc and locally split number parts.
81
81
  #
82
82
  def split number
83
- country, *cc_split_rest = internal_split number
83
+ _, *cc_split_rest = internal_split number
84
84
  cc_split_rest
85
85
  end
86
86
 
@@ -459,6 +459,7 @@ describe 'plausibility' do
459
459
  it 'is correct for Nigerian numbers' do
460
460
  Phony.plausible?('+234 807 766 1234').should be_true
461
461
  Phony.plausible?('+234 807 766 123').should be_false
462
+ Phony.plausible?('+234 909 123 1234').should be_true
462
463
  end
463
464
 
464
465
  it "is correct for Portugese numbers" do
@@ -942,6 +942,13 @@ describe 'country descriptions' do
942
942
  describe 'Niger' do
943
943
  it_splits '22712345678', ['227', false, '1234', '5678']
944
944
  end
945
+ describe 'Nigeria' do
946
+ it_splits '23411231234', %w(234 1 123 1234) # Lagos
947
+ it_splits '23470261231234', %w(234 7026 123 1234) # Mobile CDMA
948
+ it_splits '2347071231234', %w(234 707 123 1234) # Mobile
949
+ it_splits '2348051231234', %w(234 805 123 1234) # Mobile
950
+ it_splits '2349091231234', %w(234 909 123 1234) # Mobile
951
+ end
945
952
  describe 'Niue' do
946
953
  it_splits '6833651', ['683', false, '3651']
947
954
  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.10.4
4
+ version: 2.10.5
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-02-18 00:00:00.000000000 Z
11
+ date: 2015-02-25 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