phony 1.4.4 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/lib/phony/countries.rb +1 -1
- data/spec/lib/phony/countries_spec.rb +4 -3
- metadata +24 -28
data/README.textile
CHANGED
@@ -7,7 +7,7 @@ This gem can normalize, format and split E164 numbers.
|
|
7
7
|
|
8
8
|
The (admittedly crazy) *goal* of this Gem is to be able to format/split all phone numbers in the world.
|
9
9
|
|
10
|
-
Currently handles Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Greek, Hungarian, Italian, Lithuanian, Malaysian, Mexican, (The) Netherlands, New Zealand, Norwegian, Peruvian, Polish, Russian, Romanian, Slovakian, South African, South Korean, Spanish, Swedish, Swiss, Tunisian, Turkish, Liechtenstein, UK, US, and Venezuelan numbers.
|
10
|
+
Currently handles Afghan, Algerian, Austrian, Australian, Belgian, Brazilian, Chilean, Chinese, Croatian, Cuban, Czech, Danish, Dutch, Egyptian, French, German, Greek, Hungarian, Italian, Lithuanian, Malaysian, Mexican, (The) Netherlands, New Zealand, Norwegian, Peruvian, Polish, Russian, Romanian, Singapore, Slovakian, South African, South Korean, Spanish, Swedish, Swiss, Thailand, Tunisian, Turkish, Liechtenstein, UK, US, and Venezuelan numbers.
|
11
11
|
And to some extent, all others. Just try if it works for you.
|
12
12
|
|
13
13
|
If it doesn't, please "enter an issue":http://github.com/floere/phony/issues.
|
data/lib/phony/countries.rb
CHANGED
@@ -46,7 +46,7 @@ Phony.define do
|
|
46
46
|
|
47
47
|
# Greece.
|
48
48
|
#
|
49
|
-
country '30', match(/^(2[3-8]?1|69[0345789]|800)\d+$/) >> split(
|
49
|
+
country '30', match(/^(2[3-8]?1|69[0345789]|800)\d+$/) >> split(8) | # Geo/Mobile
|
50
50
|
fixed(4) >> split(6) # 3-digit NDCs
|
51
51
|
|
52
52
|
# country '31' # Netherlands, see special file.
|
@@ -88,6 +88,7 @@ describe 'country descriptions' do
|
|
88
88
|
it "handles greek numbers" do
|
89
89
|
Phony.split('3021123456').should == ['30', '21', '123456'] # Athens
|
90
90
|
Phony.split('3069512345').should == ['30', '695', '12345'] # Mobile
|
91
|
+
Phony.split('302108131234').should == ['30', '21', '08131234'] # Long mobile, noted by vilcsak in pull request #26.
|
91
92
|
Phony.split('3025941234').should == ['30', '2594', '1234']
|
92
93
|
Phony.split('3022631234').should == ['30', '2263', '1234']
|
93
94
|
end
|
@@ -100,7 +101,7 @@ describe 'country descriptions' do
|
|
100
101
|
Phony.split('3544211234').should == ['354', '421', '1234'] # Keflavík
|
101
102
|
Phony.split('3544621234').should == ['354', '462', '1234'] # Akureyri
|
102
103
|
Phony.split('3545511234').should == ['354', '551', '1234'] # Reykjavík
|
103
|
-
end
|
104
|
+
end
|
104
105
|
it "handles italian numbers" do
|
105
106
|
Phony.split('3934869528').should == ['39', '3486', '952', '8'] # Mobile
|
106
107
|
Phony.split('39068546705').should == ['39', '06', '854', '6705'] # Roma
|
@@ -205,7 +206,7 @@ describe 'country descriptions' do
|
|
205
206
|
it "handles new zealand numbers" do
|
206
207
|
Phony.split('6491234567').should == ['64', '9', '123', '4567']
|
207
208
|
end
|
208
|
-
|
209
|
+
|
209
210
|
it "handles french service numbers" do
|
210
211
|
Phony.split('33812345678').should == ['33', '8', '12','34','56','78']
|
211
212
|
end
|
@@ -213,5 +214,5 @@ describe 'country descriptions' do
|
|
213
214
|
Phony.split('41800334455').should == ['41', '800', '334', '455']
|
214
215
|
end
|
215
216
|
end
|
216
|
-
|
217
|
+
|
217
218
|
end
|
metadata
CHANGED
@@ -1,28 +1,26 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: phony
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.4.5
|
4
5
|
prerelease:
|
5
|
-
version: 1.4.4
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Florian Hanke
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-08-01 00:00:00 +10:00
|
12
|
+
date: 2011-09-30 00:00:00.000000000 +02:00
|
14
13
|
default_executable:
|
15
14
|
dependencies: []
|
16
|
-
|
17
|
-
|
15
|
+
description: ! 'Fast international phone number (E164 standard) normalizing, splitting
|
16
|
+
and formatting. Lots of formatting options: International (+.., 00..), national
|
17
|
+
(0..), and local).'
|
18
18
|
email: florian.hanke+phony@gmail.com
|
19
19
|
executables: []
|
20
|
-
|
21
20
|
extensions: []
|
22
|
-
|
23
|
-
extra_rdoc_files:
|
21
|
+
extra_rdoc_files:
|
24
22
|
- README.textile
|
25
|
-
files:
|
23
|
+
files:
|
26
24
|
- lib/phony/countries/austria.rb
|
27
25
|
- lib/phony/countries/china.rb
|
28
26
|
- lib/phony/countries/germany.rb
|
@@ -64,32 +62,30 @@ files:
|
|
64
62
|
has_rdoc: true
|
65
63
|
homepage: http://github.com/floere/phony
|
66
64
|
licenses: []
|
67
|
-
|
68
65
|
post_install_message:
|
69
66
|
rdoc_options: []
|
70
|
-
|
71
|
-
require_paths:
|
67
|
+
require_paths:
|
72
68
|
- lib
|
73
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
70
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
76
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version:
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
85
81
|
requirements: []
|
86
|
-
|
87
82
|
rubyforge_project:
|
88
83
|
rubygems_version: 1.6.2
|
89
84
|
signing_key:
|
90
85
|
specification_version: 3
|
91
|
-
summary: Fast international phone number (E164 standard) normalizing, splitting and
|
92
|
-
|
86
|
+
summary: Fast international phone number (E164 standard) normalizing, splitting and
|
87
|
+
formatting.
|
88
|
+
test_files:
|
93
89
|
- spec/lib/phony/countries_spec.rb
|
94
90
|
- spec/lib/phony/country_codes_spec.rb
|
95
91
|
- spec/lib/phony/country_spec.rb
|