itu_codes 0.2 → 0.3
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/MIT-LICENSE +20 -0
- data/README +54 -0
- data/lib/itu_codes/version.rb +3 -0
- data/lib/itu_codes.rb +500 -444
- metadata +72 -30
- data/History.txt +0 -7
- data/Manifest.txt +0 -6
- data/README.txt +0 -12
- data/Rakefile +0 -9
- data/test/itu_codes_test.rb +0 -61
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itu_codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 13
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
version: "0.3"
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Mani Tadayon
|
@@ -9,63 +14,100 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2011-02-13 00:00:00 -08:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
name: i18n
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
25
|
-
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: carmen
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: activesupport
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 3
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
description: Helper library for telephone country codes based on the official International Telecommunications Union specifications.
|
26
63
|
email:
|
27
|
-
-
|
64
|
+
- bowsersenior@gmail.com
|
28
65
|
executables: []
|
29
66
|
|
30
67
|
extensions: []
|
31
68
|
|
32
|
-
extra_rdoc_files:
|
33
|
-
|
34
|
-
- Manifest.txt
|
35
|
-
- README.txt
|
69
|
+
extra_rdoc_files: []
|
70
|
+
|
36
71
|
files:
|
37
|
-
-
|
38
|
-
- Manifest.txt
|
39
|
-
- README.txt
|
40
|
-
- Rakefile
|
72
|
+
- lib/itu_codes/version.rb
|
41
73
|
- lib/itu_codes.rb
|
42
|
-
-
|
74
|
+
- MIT-LICENSE
|
75
|
+
- README
|
43
76
|
has_rdoc: true
|
44
|
-
homepage: http://
|
77
|
+
homepage: http://github.com/bowsersenior/itu_codes
|
78
|
+
licenses: []
|
79
|
+
|
45
80
|
post_install_message:
|
46
|
-
rdoc_options:
|
47
|
-
|
48
|
-
- README.txt
|
81
|
+
rdoc_options: []
|
82
|
+
|
49
83
|
require_paths:
|
50
84
|
- lib
|
51
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
52
87
|
requirements:
|
53
88
|
- - ">="
|
54
89
|
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
55
93
|
version: "0"
|
56
|
-
version:
|
57
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
58
96
|
requirements:
|
59
97
|
- - ">="
|
60
98
|
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
99
|
+
hash: 21
|
100
|
+
segments:
|
101
|
+
- 1
|
102
|
+
- 3
|
103
|
+
- 7
|
104
|
+
version: 1.3.7
|
63
105
|
requirements: []
|
64
106
|
|
65
|
-
rubyforge_project:
|
66
|
-
rubygems_version: 1.3.
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 1.3.7
|
67
109
|
signing_key:
|
68
|
-
specification_version:
|
69
|
-
summary:
|
110
|
+
specification_version: 3
|
111
|
+
summary: Helpers for dealing with world calling codes.
|
70
112
|
test_files: []
|
71
113
|
|
data/History.txt
DELETED
data/Manifest.txt
DELETED
data/README.txt
DELETED
data/Rakefile
DELETED
data/test/itu_codes_test.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'itu_codes.rb'
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
class ItuCodesTest < Test::Unit::TestCase
|
5
|
-
def test_valid_code?
|
6
|
-
american = "1"
|
7
|
-
newyorker = "1212"
|
8
|
-
russian = "7"
|
9
|
-
alien = "alksjlkknm"
|
10
|
-
|
11
|
-
assert ItuCodes.valid_code?(american)
|
12
|
-
assert ItuCodes.valid_code?(russian)
|
13
|
-
|
14
|
-
assert ! ItuCodes.valid_code?(newyorker) # 1212 is not a country code!
|
15
|
-
assert ! ItuCodes.valid_code?(alien)
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_parse_code
|
19
|
-
american = "1"
|
20
|
-
newyorker = "1212"
|
21
|
-
russian = "7"
|
22
|
-
alien = "alksjlkknm"
|
23
|
-
|
24
|
-
assert_equal american, ItuCodes.parse_code(american)
|
25
|
-
assert_equal american, ItuCodes.parse_code(newyorker)
|
26
|
-
|
27
|
-
assert_not_equal russian, ItuCodes.parse_code(newyorker)
|
28
|
-
assert_not_equal russian, ItuCodes.parse_code(alien)
|
29
|
-
|
30
|
-
assert_not_equal alien, ItuCodes.parse_code(alien)
|
31
|
-
|
32
|
-
assert_nil ItuCodes.parse_code(alien)
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
|
-
def test_compatriots?
|
37
|
-
american = "1"
|
38
|
-
newyorker = "1212"
|
39
|
-
angeleno = "1818"
|
40
|
-
russian = "7"
|
41
|
-
alien = "alksjlkknm"
|
42
|
-
|
43
|
-
assert ItuCodes.compatriots?(newyorker, angeleno)
|
44
|
-
assert ItuCodes.compatriots?(newyorker, american)
|
45
|
-
|
46
|
-
assert ! ItuCodes.compatriots?(newyorker, russian)
|
47
|
-
assert ! ItuCodes.compatriots?(american, russian )
|
48
|
-
|
49
|
-
assert nil == ItuCodes.compatriots?(american, alien)
|
50
|
-
assert nil == ItuCodes.compatriots?(alien, alien)
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_find
|
54
|
-
assert_equal( [{"995" => "Georgia"}], ItuCodes.find("Georgia") )
|
55
|
-
assert_equal( [{"995" => "Georgia"}], ItuCodes.find(995) )
|
56
|
-
assert_equal( [{"995" => "Georgia"}], ItuCodes.find("995") )
|
57
|
-
assert_equal( [], ItuCodes.find("12345678") )
|
58
|
-
assert_equal( [], ItuCodes.find("someverylongandnonterritorialstring") )
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|