phony 2.0.0.beta12 → 2.0.0.beta13
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 +8 -8
- data/README.textile +1 -0
- data/lib/phony/countries.rb +2 -1
- data/spec/lib/phony/validations_spec.rb +16 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGM3YzY5ZGU1OWYxZjQ1ZTRmNWEzMTRmNTFkZDM2YzliNTQzMjU3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGUwYmEzYzdlOWM1NmFkYjczNTJkNWQxN2JhZThkZGE3YzNiYjI0Yw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWE5ZDEwNmNiNjI0YzIzZjM3NzYyNDY4YzNhMDc5NDg5YzhjYmI1ZGJlM2Y4
|
10
|
+
NWVkYzg4YTZlY2ZjOWJkMzkzYzMyMzE1NmM2Njk0M2RmNmEwMjFmNDJiMzFh
|
11
|
+
NTRjNmFkYjZmZjRhNzc2ZGQzMTYwYjA2ZmI0NDg0MjI3ZGQ4MDg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGIwZmQ2YWJlMTY0NjNmMTMyNWUzYTM0OGZlMmUyOWVlMjg3MGVhMmRlYjUy
|
14
|
+
Y2Q1YWM2OTI4NDQ2MTNlMzg4NDExNDgzMzJkNzkzYzNmMDUwZjJhNDdlY2Rm
|
15
|
+
YTdmODY3MmM0ZDQxZjA3NjZkN2Q0ODMxYzNmNTE2NzBiNGU5NTQ=
|
data/README.textile
CHANGED
data/lib/phony/countries.rb
CHANGED
@@ -110,7 +110,7 @@ Phony.define do
|
|
110
110
|
#
|
111
111
|
country '45',
|
112
112
|
none >> split(2,2,2,2..2)
|
113
|
-
|
113
|
+
|
114
114
|
# country '46' # Sweden, see special file.
|
115
115
|
|
116
116
|
# Norway.
|
@@ -853,6 +853,7 @@ Phony.define do
|
|
853
853
|
# Cambodia (Kingdom of)
|
854
854
|
# http://en.wikipedia.org/wiki/Telephone_numbers_in_Cambodia
|
855
855
|
country '855',
|
856
|
+
match(/^(1\d{1})/) >> split(3, 3) |
|
856
857
|
fixed(2) >> matched_split(/^\d{6}$/ => [3,3], /^\d{7}$/ => [3,4])
|
857
858
|
|
858
859
|
# Lao People's Democratic Republic http://www.wtng.info/wtng-856-la.html, https://www.numberingplans.com
|
@@ -325,10 +325,22 @@ describe 'validations' do
|
|
325
325
|
it_is_correct_for 'Brunei Darussalam', :samples => '+673 5 523 876'
|
326
326
|
it_is_correct_for 'Burkina Faso', :samples => '+226 1476 2312'
|
327
327
|
it_is_correct_for 'Burundi', :samples => '+257 1234 5678'
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
328
|
+
|
329
|
+
it 'is correct for Cambodia' do
|
330
|
+
# 7 digit identifiers
|
331
|
+
Phony.plausible?("+855965787807").should be_true # Smart
|
332
|
+
Phony.plausible?("+855312067777").should be_true # Beeline
|
333
|
+
Phony.plausible?("+855383001801").should be_true # CooTel
|
334
|
+
Phony.plausible?("+855973001801").should be_true # Metfone
|
335
|
+
Phony.plausible?("+855883001801").should be_true # Metfone
|
336
|
+
Phony.plausible?("+85510234567").should be_true # Smart
|
337
|
+
Phony.plausible?("+85511234564").should be_true # Mobitel (former Mfone)
|
338
|
+
Phony.plausible?("+855 12 236 142").should be_true # Mobitel
|
339
|
+
Phony.plausible?("+855 234 601 183").should be_true # Long fixed line (Phnom Penh)
|
340
|
+
Phony.plausible?("855 33 123 456").should be_true # Regular fixed line (Kampot)
|
341
|
+
Phony.plausible?("+855102345678").should be_false # Too many digits for a 01 prefix
|
342
|
+
end
|
343
|
+
|
332
344
|
it_is_correct_for 'Cameroon', :samples => '+237 7372 8186'
|
333
345
|
it_is_correct_for 'Cape Verde', :samples => '+238 642 3843'
|
334
346
|
it_is_correct_for 'Central African Republic', :samples => '+236 1234 5678'
|
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.0.0.
|
4
|
+
version: 2.0.0.beta13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Hanke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-26 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
|
@@ -126,3 +126,4 @@ test_files:
|
|
126
126
|
- spec/lib/phony/validations_spec.rb
|
127
127
|
- spec/lib/phony/vanity_spec.rb
|
128
128
|
- spec/lib/phony_spec.rb
|
129
|
+
has_rdoc: false
|