phony 2.10.0 → 2.10.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 +4 -4
- data/lib/phony/countries/sweden.rb +5 -3
- data/spec/functional/plausibility_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9943aad9809e0b815de5e6ffa2d73fba1cf093b7
|
4
|
+
data.tar.gz: 0b6b005750e5ec98bde255f8be798bbd17fe309a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fda36df66cb5aee397d7233bc77c93806568006c1d480acbd4ff9c69269b1e8ba8836cdd1c6093637c6cd184addf6de997c639435cf6c401a8bf48b95dd8d14
|
7
|
+
data.tar.gz: 3556dd2e0b8062e3064d02a1ccba3139c6e44d93fdfcb91b5b7123f7371936174658047420b8b1045655105f279ffe525c8f38f9eacfaaa21c48ba6cf14e532f
|
@@ -54,9 +54,11 @@ service = [
|
|
54
54
|
]
|
55
55
|
|
56
56
|
Phony.define do
|
57
|
-
country '46',
|
57
|
+
country '46',
|
58
58
|
trunk('0') |
|
59
59
|
one_of(service) >> split(3,3) |
|
60
|
-
one_of(ndcs + mobile) >>
|
60
|
+
one_of(ndcs + mobile) >> matched_split(
|
61
|
+
/^\d{6}$/ => [2, 2, 2], /^\d{7}$/ => [3, 2, 2], /^\d{8}$/ => [3, 2, 3]
|
62
|
+
) |
|
61
63
|
fixed(3) >> split(3,3,2) # catchall
|
62
|
-
end
|
64
|
+
end
|
@@ -485,6 +485,14 @@ describe 'plausibility' do
|
|
485
485
|
Phony.plausible?('+41 44 111 22').should be_false
|
486
486
|
end
|
487
487
|
|
488
|
+
it "is correct for Swedish numbers" do
|
489
|
+
Phony.plausible?('+46 8 506 10 60').should be_true
|
490
|
+
Phony.plausible?('+46 8 506 106 00').should be_true
|
491
|
+
Phony.plausible?('+46 19 764 22 00').should be_true
|
492
|
+
Phony.plausible?('+46 19 20 88 50').should be_true
|
493
|
+
Phony.plausible?('+46 19 20 88').should be_false # too short
|
494
|
+
end
|
495
|
+
|
488
496
|
it "is correct for Vietnamese numbers" do
|
489
497
|
Phony.plausible?('+84 8 3827 9666').should be_true
|
490
498
|
Phony.plausible?('+84 4 3926 1720').should be_true
|
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
|
+
version: 2.10.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: 2015-01-
|
11
|
+
date: 2015-01-13 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
|