phony 2.20.15 → 2.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +1 -1
- data/lib/phony/countries.rb +10 -1
- data/lib/phony/country_codes.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02b329c1ab61ea9001d3c022816bc609f7013e5b4f07ba73841215dca6d11800
|
4
|
+
data.tar.gz: 5c5a7085c12ffff3f4aa3175ccfec72c37a2a7fefbe73e5c6153b318a12de517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca0a0918aaf7478dfa46a00d47f29287e19cdb0542205d89b8a2f46bba017e87a413d370ed609fae4e240fe2e7444bde3a6eb5b302afab0c4154f961a0c593e
|
7
|
+
data.tar.gz: 2e6b77c1a16a7dcff55f55a255586fafbddbddde4e99c072f1c88b7c295f6f4fef8d8faae2e40a51417ceac1f87988ff12bca81d6d98a8c96fccaca13dfb6649
|
data/README.textile
CHANGED
@@ -108,7 +108,7 @@ Mildly unmaintained list: Abhas, Afghan, Algerian, Argentina, Austrian, Australi
|
|
108
108
|
|
109
109
|
h2. Proud Sponsors
|
110
110
|
|
111
|
-
* Renuo AG (July
|
111
|
+
* Renuo AG (July 2022 – January 2025): "Github":https://github.com/renuo, "Homepage":https://www.renuo.ch. Much appreciated!
|
112
112
|
|
113
113
|
h2. License
|
114
114
|
|
data/lib/phony/countries.rb
CHANGED
@@ -371,7 +371,16 @@ Phony.define do
|
|
371
371
|
|
372
372
|
country '227', none >> split(4, 4) # Niger http://www.wtng.info/wtng-227-ne.html
|
373
373
|
country '228', none >> split(4, 4) # Togolese Republic http://www.wtng.info/wtng-228-tg.html
|
374
|
-
|
374
|
+
|
375
|
+
# Benin http://www.itu.int/oth/T0202000017/en
|
376
|
+
#
|
377
|
+
# There is no trunk code for this country and prefixes start with 0
|
378
|
+
country '229',
|
379
|
+
trunk('', normalize: false) |
|
380
|
+
none >> matched_split(
|
381
|
+
# Old empty and new 01 prefix.
|
382
|
+
/\A(01)?\d+\z/ => [2, 2, 2, 2, 2]
|
383
|
+
)
|
375
384
|
|
376
385
|
# Mauritius
|
377
386
|
# http://www.wtng.info/wtng-230-mu.html
|
data/lib/phony/country_codes.rb
CHANGED
@@ -94,6 +94,11 @@ module Phony
|
|
94
94
|
# Is this number plausible?
|
95
95
|
#
|
96
96
|
def plausible?(number, hints = {})
|
97
|
+
# Fail if it contains too many of certain phone specific markers:
|
98
|
+
# * more than 1 +
|
99
|
+
#
|
100
|
+
return false if number.count('+') > 1
|
101
|
+
|
97
102
|
normalized = clean number
|
98
103
|
|
99
104
|
# False if it fails the basic check.
|
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.
|
4
|
+
version: 2.21.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:
|
11
|
+
date: 2025-01-03 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
|