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.
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
- version: "0.2"
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: 2009-04-14 00:00:00 -07:00
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: hoe
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
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
- version: 1.12.1
24
- version:
25
- description: Easy to use tools to look up and parse international calling codes.
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
- - mta5@me.com
64
+ - bowsersenior@gmail.com
28
65
  executables: []
29
66
 
30
67
  extensions: []
31
68
 
32
- extra_rdoc_files:
33
- - History.txt
34
- - Manifest.txt
35
- - README.txt
69
+ extra_rdoc_files: []
70
+
36
71
  files:
37
- - History.txt
38
- - Manifest.txt
39
- - README.txt
40
- - Rakefile
72
+ - lib/itu_codes/version.rb
41
73
  - lib/itu_codes.rb
42
- - test/itu_codes_test.rb
74
+ - MIT-LICENSE
75
+ - README
43
76
  has_rdoc: true
44
- homepage: http://rubyforge.org/projects/itu-codes
77
+ homepage: http://github.com/bowsersenior/itu_codes
78
+ licenses: []
79
+
45
80
  post_install_message:
46
- rdoc_options:
47
- - --main
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
- version: "0"
62
- version:
99
+ hash: 21
100
+ segments:
101
+ - 1
102
+ - 3
103
+ - 7
104
+ version: 1.3.7
63
105
  requirements: []
64
106
 
65
- rubyforge_project: bowser_senior
66
- rubygems_version: 1.3.1
107
+ rubyforge_project:
108
+ rubygems_version: 1.3.7
67
109
  signing_key:
68
- specification_version: 2
69
- summary: Easy to use tools to look up and parse international calling codes.
110
+ specification_version: 3
111
+ summary: Helpers for dealing with world calling codes.
70
112
  test_files: []
71
113
 
data/History.txt DELETED
@@ -1,7 +0,0 @@
1
- === 0.2 / 2009-04-14
2
-
3
- * Cleaned up code and added to GitHub. Created a gem.
4
-
5
- === 0.1 / 2009-03-20
6
-
7
- * Started work.
data/Manifest.txt DELETED
@@ -1,6 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- Rakefile
5
- lib/itu_codes.rb
6
- test/itu_codes_test.rb
data/README.txt DELETED
@@ -1,12 +0,0 @@
1
- = hellohoe
2
-
3
- * http://rubyforge.org/projects/itu-codes
4
- * http://github.com/bowsersenior/itu-codes/tree/master
5
-
6
- == DESCRIPTION:
7
-
8
- Easy to use tools to look up and parse international calling codes.
9
-
10
- == LICENSE:
11
-
12
- MIT License.
data/Rakefile DELETED
@@ -1,9 +0,0 @@
1
- require 'hoe'
2
- require './lib/itu_codes.rb'
3
-
4
- Hoe.new('itu_codes', ItuCodes::VERSION) do |p|
5
-
6
- p.rubyforge_name = 'bowser_senior'
7
-
8
- p.developer( 'Mani Tadayon', 'mta5@me.com' )
9
- end
@@ -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