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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 149c31aeeafd871ed8e08201ade25314998da9e1
4
- data.tar.gz: f9160fe2f2da602bbb10259d95f4a12bea57290b
3
+ metadata.gz: 9943aad9809e0b815de5e6ffa2d73fba1cf093b7
4
+ data.tar.gz: 0b6b005750e5ec98bde255f8be798bbd17fe309a
5
5
  SHA512:
6
- metadata.gz: 62f5e978d9aa5331c924f14c86efc9251d057f6c140ef606ff8d33c05a10d30735a2aa2e2745ad1f68f4d6ed398405bf3933614af3d356c2b80527bf140b4d89
7
- data.tar.gz: 3fec76eb6b6359e3ee54e9f6c373f062a1e25850650e1d7291db71d69005787269893e8463770973bf04e8b7125e8fa20e509ce18e773a28fc45b193ab9b6f09
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) >> split(3,2,2) |
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.0
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-06 00:00:00.000000000 Z
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