phony 2.15.47 → 2.15.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phony/countries.rb +4 -1
- data/lib/phony/country_codes.rb +1 -1
- data/spec/functional/plausibility_spec.rb +2 -0
- data/spec/lib/phony/countries_spec.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f656832e7311c29b6d9cd2c4d38fdeba7701f4f7
|
4
|
+
data.tar.gz: 8abed66486b0361361d39cd6270f36c11340a0ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c44871ae99e9b3a31a20134c603f7520144bcfe65d534fedbae73d2311c808f18ce40e2318dec72ebd56de0d433001259196e77a77da12691627a8e5c5414827
|
7
|
+
data.tar.gz: 88847020258becb45f509a7c0de97bc8ec1c2c8df918d76ab4ac5df2a4ae7a43615075aa4c67d896429f112e7b76f4cd0ec3005b15327d9113a1ace0c4fa32ab
|
data/lib/phony/countries.rb
CHANGED
@@ -279,7 +279,10 @@ Phony.define do
|
|
279
279
|
# Singapore (Republic of).
|
280
280
|
#
|
281
281
|
country '65',
|
282
|
-
none >>
|
282
|
+
none >> matched_split(
|
283
|
+
/^(800)\d{7}$/ => [3,3,4], # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
|
284
|
+
/^\d{8}$/ => [4,4] # TODO Short Codes
|
285
|
+
)
|
283
286
|
|
284
287
|
# Thailand.
|
285
288
|
#
|
data/lib/phony/country_codes.rb
CHANGED
@@ -77,7 +77,7 @@ module Phony
|
|
77
77
|
country, cc, national_number = partial_split number
|
78
78
|
|
79
79
|
# Split the national number into ndc and local part.
|
80
|
-
|
80
|
+
_, ndc, *local = country.split national_number
|
81
81
|
|
82
82
|
[cc, ndc, *local]
|
83
83
|
end
|
@@ -268,6 +268,8 @@ describe 'plausibility' do
|
|
268
268
|
['+381 62 12 34567', '+381 62 12 3456'],
|
269
269
|
['+381 65 12 34567', '+381 65 12 3456']]
|
270
270
|
it_is_correct_for 'Sierra Leone', :samples => '+232 42 393 972'
|
271
|
+
it_is_correct_for 'Singapore', :samples => ['+65 6123 1234',
|
272
|
+
'+65 800 852 1234']
|
271
273
|
it_is_correct_for 'Solomon Islands', :samples => '+677 97851'
|
272
274
|
it_is_correct_for 'Somali Democratic Republic', :samples => ['+252 1034 123 45',
|
273
275
|
'+252 1313 123',
|
@@ -661,7 +661,8 @@ describe 'country descriptions' do
|
|
661
661
|
end
|
662
662
|
|
663
663
|
describe 'Singapore' do
|
664
|
-
it_splits '6561231234',
|
664
|
+
it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
|
665
|
+
it_splits '658008521234', ['65', false, '800', '852', '1234'] # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
|
665
666
|
end
|
666
667
|
describe 'Slovakia' do
|
667
668
|
it_splits '421912123456', ['421', '912', '123456'] # Mobile
|
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.15.
|
4
|
+
version: 2.15.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-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
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.4.5.1
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Fast international phone number (E164 standard) normalizing, splitting and
|