phony 2.15.48 → 2.15.49
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 +2 -0
- data/lib/phony/countries/cambodia.rb +1 -1
- data/spec/functional/plausibility_spec.rb +4 -0
- data/spec/lib/phony/countries_spec.rb +2 -0
- 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: f2d261312b89cd2670ec6b20a58f8464b85a3371
|
4
|
+
data.tar.gz: 7f2e0bdf26ec96c440b77caac7db75ef00f2c4d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88dcbcfac2df06d7692787ac8781d87b94e8ebc24f838b7ee9717a4c6030f90e3522e3e7476afde083c46d69557d55fc7c76592ad8fdd2d065a43db4ac30de6f
|
7
|
+
data.tar.gz: 9515d295a853c699c1301266ad54b7e529a02f64d097b5517eda3e80df38c824256a9c52fb92894793a6783e44c091aa94d89f376bd46bf7c24feb8eaa485e66
|
data/lib/phony/countries.rb
CHANGED
@@ -274,6 +274,8 @@ Phony.define do
|
|
274
274
|
match(/^(2\d)\d{7}$/) >> split(3,4) | # Mobile
|
275
275
|
match(/^(2\d)\d{6}$/) >> split(3,3) |
|
276
276
|
match(/^(2\d)\d{8}$/) >> split(2,3,3) |
|
277
|
+
match(/^(800)\d{6}$/) >> split(3,3) | # International 800 service where agreed
|
278
|
+
match(/^(800)\d{7}$/) >> split(3,4) | # International 800 service where agreed
|
277
279
|
fixed(1) >> split(3,4) # Rest
|
278
280
|
|
279
281
|
# Singapore (Republic of).
|
@@ -125,7 +125,7 @@ seven_digit_total_double_digit_fixed_line_prefixes = [
|
|
125
125
|
Phony.define do
|
126
126
|
country '855', trunk('0', :normalize => true) |
|
127
127
|
one_of(mobile_prefixes_with_variable_length) >> matched_split(/^9/ => [3, 4], /^[2-8]/ => [3, 3]) |
|
128
|
-
one_of(variable_length_extended_range_mobile_prefixes) >> matched_split(/^1/ => [3, 4], /^[2-
|
128
|
+
one_of(variable_length_extended_range_mobile_prefixes) >> matched_split(/^1/ => [3, 4], /^[2-9]/ => [3, 3]) |
|
129
129
|
one_of(six_digit_mobile_prefixes) >> matched_split(/^[2-9]/ => [3, 3]) |
|
130
130
|
one_of(six_digit_extended_range_mobile_prefixes) >> matched_split(/^[1-9]/ => [3, 3]) |
|
131
131
|
one_of(seven_digit_mobile_prefixes) >> matched_split(/^[2-9]/ => [3, 4]) |
|
@@ -218,6 +218,10 @@ describe 'plausibility' do
|
|
218
218
|
'+977 10 123 456',
|
219
219
|
'+977 98 1234 5678']
|
220
220
|
it_is_correct_for "New Caledonia (Territoire français d'outre-mer)", :samples => '+687 546 835'
|
221
|
+
it 'is correct for New Zealand' do
|
222
|
+
Phony.plausible?('+64800123123').should be_true # Free phone
|
223
|
+
Phony.plausible?('+648001231234').should be_true # Free phone
|
224
|
+
end
|
221
225
|
it_is_correct_for 'Nicaragua', :samples => '+505 12 345 678'
|
222
226
|
it_is_correct_for 'Niger', :samples => '+227 1234 5678'
|
223
227
|
it_is_correct_for 'Niue', :samples => '+683 3791'
|
@@ -794,6 +794,8 @@ describe 'country descriptions' do
|
|
794
794
|
end
|
795
795
|
describe 'New Zealand' do
|
796
796
|
it_splits '6491234567', ['64', '9', '123', '4567']
|
797
|
+
it_splits '64800123123', ['64', '800', '123', '123']
|
798
|
+
it_splits '648001231234', ['64', '800', '123', '1234']
|
797
799
|
end
|
798
800
|
describe 'Bhutan (Kingdom of)' do
|
799
801
|
it_splits '9759723642', %w(975 9 723 642)
|
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.49
|
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-11-24 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.6.13
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Fast international phone number (E164 standard) normalizing, splitting and
|