e164 0.3.0 → 0.3.1
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.
- data/VERSION +1 -1
- data/e164.gemspec +5 -9
- data/lib/e164/country_codes.rb +0 -3
- data/spec/e164_spec.rb +10 -0
- metadata +19 -22
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/e164.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{e164}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{hexorx}]
|
12
|
+
s.date = %q{2011-11-03}
|
13
13
|
s.description = %q{The e164 gem can parse and normalize numbers into the e164 format.
|
14
14
|
It provides extra information on the Country Code and National Destination Codes.
|
15
15
|
It can be used standalone or mixed into a model.}
|
@@ -37,13 +37,9 @@ Gem::Specification.new do |s|
|
|
37
37
|
"spec/spec_helper.rb"
|
38
38
|
]
|
39
39
|
s.homepage = %q{http://github.com/hexorx/e164}
|
40
|
-
s.require_paths = [
|
41
|
-
s.rubygems_version = %q{1.6
|
40
|
+
s.require_paths = [%q{lib}]
|
41
|
+
s.rubygems_version = %q{1.8.6}
|
42
42
|
s.summary = %q{This gem provides e164 parsing and normalization}
|
43
|
-
s.test_files = [
|
44
|
-
"spec/e164_spec.rb",
|
45
|
-
"spec/spec_helper.rb"
|
46
|
-
]
|
47
43
|
|
48
44
|
if s.respond_to? :specification_version then
|
49
45
|
s.specification_version = 3
|
data/lib/e164/country_codes.rb
CHANGED
@@ -15,13 +15,10 @@ CountryCodes = {
|
|
15
15
|
'33' => {:national_destination_codes => 1, :abbreviation => '', :description => 'France', :info => 'en.wikipedia.com.org/wiki/France'},
|
16
16
|
'34' => {:national_destination_codes => 2, :abbreviation => '', :description => 'Spain', :info => 'en.wikipedia.com.org/wiki/Spain'},
|
17
17
|
'36' => {:national_destination_codes => 2, :abbreviation => '', :description => 'Hungary', :info => 'en.wikipedia.com.org/wiki/Hungary'},
|
18
|
-
'37' => {:national_destination_codes => 2, :abbreviation => '', :description => 'discontinued (was assigned to the [German Democratic Republic] (East Germany) until April 1992.', :info => ''},
|
19
|
-
'38' => {:national_destination_codes => 2, :abbreviation => '', :description => 'discontinued (was assigned to [Yugoslavia] before break', :info => ''},
|
20
18
|
'39' => {:national_destination_codes => 3, :abbreviation => '', :description => 'Italy', :info => 'en.wikipedia.com.org/wiki/Italy'},
|
21
19
|
|
22
20
|
'40' => {:national_destination_codes => 2, :abbreviation => '', :description => 'Romania', :info => 'en.wikipedia.com.org/wiki/Romania'},
|
23
21
|
'41' => {:national_destination_codes => 2, :abbreviation => '', :description => 'Switzerland', :info => 'en.wikipedia.com.org/wiki/Switzerland'},
|
24
|
-
'42' => {:national_destination_codes => 2, :abbreviation => '', :description => 'previously assigned to [Czechoslovakia] until its breakup. Czech Republic and Slovakia used this common code until 1 March 1997.', :info => ''},
|
25
22
|
'43' => {:national_destination_codes => Austria, :abbreviation => '', :description => 'Austria', :info => 'en.wikipedia.com.org/wiki/Austria'},
|
26
23
|
'44' => {:national_destination_codes => 2, :abbreviation => '', :description => 'United Kingdom', :info => 'en.wikipedia.com.org/wiki/United_Kingdom'},
|
27
24
|
'45' => {:national_destination_codes => 2, :abbreviation => '', :description => 'Denmark', :info => 'en.wikipedia.com.org/wiki/Denmark'},
|
data/spec/e164_spec.rb
CHANGED
@@ -42,4 +42,14 @@ describe E164 do
|
|
42
42
|
E164.normalize('00441234567890').should == '+441234567890'
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
describe "#parse" do
|
47
|
+
CountryCodes.each do |code, data|
|
48
|
+
it "should pick up the correct country code for #{data[:description]} when in + format" do
|
49
|
+
# Create a false number in + format because the code provided is correct
|
50
|
+
fake_number = "+#{code}1234567"
|
51
|
+
E164.parse(fake_number)[0].should == code
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
45
55
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: e164
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- hexorx
|
@@ -15,13 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-11-03 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
type: :development
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
22
|
none: false
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
@@ -31,11 +28,11 @@ dependencies:
|
|
31
28
|
- 0
|
32
29
|
version: "0"
|
33
30
|
name: jeweler
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
prerelease: false
|
37
31
|
type: :development
|
38
|
-
|
32
|
+
prerelease: false
|
33
|
+
requirement: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
36
|
none: false
|
40
37
|
requirements:
|
41
38
|
- - ">="
|
@@ -45,11 +42,11 @@ dependencies:
|
|
45
42
|
- 0
|
46
43
|
version: "0"
|
47
44
|
name: rspec
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
prerelease: false
|
51
45
|
type: :development
|
52
|
-
|
46
|
+
prerelease: false
|
47
|
+
requirement: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
51
|
requirements:
|
55
52
|
- - ">="
|
@@ -59,7 +56,9 @@ dependencies:
|
|
59
56
|
- 0
|
60
57
|
version: "0"
|
61
58
|
name: rspec
|
62
|
-
|
59
|
+
type: :development
|
60
|
+
prerelease: false
|
61
|
+
requirement: *id003
|
63
62
|
description: |-
|
64
63
|
The e164 gem can parse and normalize numbers into the e164 format.
|
65
64
|
It provides extra information on the Country Code and National Destination Codes.
|
@@ -89,7 +88,6 @@ files:
|
|
89
88
|
- lib/load_data.sql
|
90
89
|
- spec/e164_spec.rb
|
91
90
|
- spec/spec_helper.rb
|
92
|
-
has_rdoc: true
|
93
91
|
homepage: http://github.com/hexorx/e164
|
94
92
|
licenses: []
|
95
93
|
|
@@ -119,10 +117,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
117
|
requirements: []
|
120
118
|
|
121
119
|
rubyforge_project:
|
122
|
-
rubygems_version: 1.6
|
120
|
+
rubygems_version: 1.8.6
|
123
121
|
signing_key:
|
124
122
|
specification_version: 3
|
125
123
|
summary: This gem provides e164 parsing and normalization
|
126
|
-
test_files:
|
127
|
-
|
128
|
-
- spec/spec_helper.rb
|
124
|
+
test_files: []
|
125
|
+
|