phony 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cab09437919d2b8ac9980c997aca16b6029bc14b
4
- data.tar.gz: c764db5c678f5bc78c6a49180319b7647e7c39a1
3
+ metadata.gz: d477f31e7f4d8aa21386f93f8ce3e07bbf91c750
4
+ data.tar.gz: 40398d6c86212888d8b8355a12d22112c5ca2c51
5
5
  SHA512:
6
- metadata.gz: b6261b97af629e5f22fcfd53dff8c91decee37fa4ac50fec962cb065eab5e799ab33df8fe4c1997a22641a8facafa91af5a0f2a270a3c9a691d250f4f3411b71
7
- data.tar.gz: 74e8df4cb1aa40c3416d8813a13d5e04639c54a0070293af51c792f60f5fecb914c2efdd8b5e8bc9aea79f7057c8597795ba935d17a2f4c855e7e7103cdce585
6
+ metadata.gz: f9f4548b3395335f5f018f33f3a1e8272d8d946bbe08883173661ad11c93eea2630d7b282cc0c5f0d78fc01fb0da6e000ac268da1d55451de8ac3f7c913c06df
7
+ data.tar.gz: 9c2f65bb9e2d198671e2de781a1bd93e5f7eb944dbab0ca55589609fe76b8096aed083c33fd8f19226d7ebd6f54ce717da397625b2cceea1713a6e69ae745818
@@ -26,8 +26,6 @@ corporate = [
26
26
  ]
27
27
 
28
28
  mobile = [
29
- '67',
30
- '68',
31
29
  '644',
32
30
  '650',
33
31
  '651',
@@ -38,7 +36,6 @@ mobile = [
38
36
  '659',
39
37
  '660',
40
38
  '661',
41
- '663',
42
39
  '664',
43
40
  '665',
44
41
  '666',
@@ -49,7 +46,7 @@ mobile = [
49
46
  '680',
50
47
  '681',
51
48
  '688',
52
- '699'
49
+ '699',
53
50
  ]
54
51
 
55
52
  service = [
@@ -83,5 +80,6 @@ Phony.define do
83
80
  one_of(corporate) >> split(5..5) |
84
81
  one_of(ndcs) >> split(6..6) |
85
82
  one_of(mobile) >> split(7..7) |
83
+ one_of('663') >> split(6..6) | # 6 digit mobile.
86
84
  fixed(4) >> split(7..7)
87
85
  end
@@ -114,6 +114,17 @@ describe 'plausibility' do
114
114
  end
115
115
 
116
116
  context 'specific countries' do
117
+ it "is correct for Austria" do
118
+ Phony.plausible?('+43 501 12345').should be_true
119
+ Phony.plausible?('+43 501 1234').should be_false # too short
120
+ Phony.plausible?('+43 501 123456').should be_false # too long
121
+ Phony.plausible?('+43 800 123456789').should be_true
122
+
123
+ # Mobile
124
+ Phony.plausible?('+43 676 0000000').should be_true
125
+ # 663 mobile numbers have 6 digits
126
+ Phony.plausible?('+43 663 000000').should be_true
127
+ end
117
128
 
118
129
  # TODO: more needs to be done here
119
130
  #
@@ -235,13 +246,6 @@ describe 'plausibility' do
235
246
  Phony.plausible?('796030123451').should be_false # too long
236
247
  end
237
248
 
238
- it "is correct for Austria" do
239
- Phony.plausible?('+43 501 12345').should be_true
240
- Phony.plausible?('+43 501 1234').should be_false # too short
241
- Phony.plausible?('+43 501 123456').should be_false # too long
242
- Phony.plausible?('+43 800 123456789').should be_true
243
- end
244
-
245
249
  it "is correct for Azerbaijan" do
246
250
  Phony.plausible?('+994 12 1234567').should be_true
247
251
  Phony.plausible?('+994 12 12345').should be_false # too short
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.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Hanke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-02-22 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