iso_country_codes 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -2
- data/History.txt +5 -0
- data/README.rdoc +3 -0
- data/VERSION.yml +3 -3
- data/iso_country_codes.gemspec +64 -0
- data/lib/iso_country_codes/code.rb +4 -0
- data/lib/iso_country_codes/iso_3166_1.rb +1 -1
- data/lib/iso_country_codes/iso_country_codes.rb +5 -0
- data/test/iso_country_codes_test.rb +10 -1
- metadata +20 -7
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -31,6 +31,9 @@ Provides ISO codes, names and currencies for countries.
|
|
31
31
|
# Fetch a country's local currency
|
32
32
|
IsoCountryCodes.find('aus').currency # => "AUD"
|
33
33
|
|
34
|
+
# Output an Array of countries and their codes for use form helper methods
|
35
|
+
IsoCountryCodes.for_select # => Array
|
36
|
+
|
34
37
|
== INSTALL:
|
35
38
|
|
36
39
|
gem install iso_country_codes
|
data/VERSION.yml
CHANGED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "iso_country_codes"
|
8
|
+
s.version = "0.3.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["alex"]
|
12
|
+
s.date = "2012-03-13"
|
13
|
+
s.description = "ISO country code and currency library"
|
14
|
+
s.email = "alexrabarts@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.rdoc"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"Gemfile",
|
20
|
+
"Gemfile.lock",
|
21
|
+
"History.txt",
|
22
|
+
"Manifest.txt",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION.yml",
|
26
|
+
"iso_country_codes.gemspec",
|
27
|
+
"lib/iso_country_codes.rb",
|
28
|
+
"lib/iso_country_codes/code.rb",
|
29
|
+
"lib/iso_country_codes/iso_3166_1.rb",
|
30
|
+
"lib/iso_country_codes/iso_4217.rb",
|
31
|
+
"lib/iso_country_codes/iso_country_codes.rb",
|
32
|
+
"rakelib/cultivate.rake",
|
33
|
+
"rakelib/iso_3166_1.rake",
|
34
|
+
"rakelib/iso_3166_1.rb",
|
35
|
+
"rakelib/iso_3166_1.rb.erb",
|
36
|
+
"test/iso_country_codes_test.rb"
|
37
|
+
]
|
38
|
+
s.homepage = "http://github.com/alexrabarts/iso_country_codes"
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = "1.8.10"
|
41
|
+
s.summary = "Provides ISO 3166-1 country codes/names and ISO 4217 currencies."
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<rdoc>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<nokogiri>, [">= 0"])
|
51
|
+
else
|
52
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
53
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
54
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
55
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
56
|
+
end
|
57
|
+
else
|
58
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
59
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
60
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
61
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
@@ -77,12 +77,21 @@ class TestIsoCountryCodes < Test::Unit::TestCase
|
|
77
77
|
assert_equal 'AUS', IsoCountryCodes::Code::AUS.alpha3
|
78
78
|
assert_equal 'AUS', IsoCountryCodes::Code::AUS.instance.alpha3
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def test_get_name
|
82
82
|
assert_equal 'Australia', IsoCountryCodes::Code::AUS.name
|
83
83
|
assert_equal 'Australia', IsoCountryCodes::Code::AUS.instance.name
|
84
84
|
end
|
85
85
|
|
86
|
+
def test_for_select
|
87
|
+
assert IsoCountryCodes::Code.for_select.is_a?(Array)
|
88
|
+
assert_equal IsoCountryCodes::Code.for_select.length, IsoCountryCodes::Code.all.length
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_for_select_value_attribute
|
92
|
+
assert_equal IsoCountryCodes::Code.for_select(:alpha3)[0][1].length, 3
|
93
|
+
end
|
94
|
+
|
86
95
|
def test_unknown_iso_code
|
87
96
|
assert_raises IsoCountryCodes::UnknownCodeError do
|
88
97
|
IsoCountryCodes.find('FOO')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso_country_codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 2
|
9
8
|
- 3
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- alex
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
19
|
-
default_executable:
|
18
|
+
date: 2012-03-13 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: rake
|
@@ -60,6 +59,20 @@ dependencies:
|
|
60
59
|
version: "0"
|
61
60
|
type: :development
|
62
61
|
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: nokogiri
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
type: :development
|
75
|
+
version_requirements: *id004
|
63
76
|
description: ISO country code and currency library
|
64
77
|
email: alexrabarts@gmail.com
|
65
78
|
executables: []
|
@@ -76,6 +89,7 @@ files:
|
|
76
89
|
- README.rdoc
|
77
90
|
- Rakefile
|
78
91
|
- VERSION.yml
|
92
|
+
- iso_country_codes.gemspec
|
79
93
|
- lib/iso_country_codes.rb
|
80
94
|
- lib/iso_country_codes/code.rb
|
81
95
|
- lib/iso_country_codes/iso_3166_1.rb
|
@@ -86,7 +100,6 @@ files:
|
|
86
100
|
- rakelib/iso_3166_1.rb
|
87
101
|
- rakelib/iso_3166_1.rb.erb
|
88
102
|
- test/iso_country_codes_test.rb
|
89
|
-
has_rdoc: true
|
90
103
|
homepage: http://github.com/alexrabarts/iso_country_codes
|
91
104
|
licenses: []
|
92
105
|
|
@@ -116,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
129
|
requirements: []
|
117
130
|
|
118
131
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.
|
132
|
+
rubygems_version: 1.8.10
|
120
133
|
signing_key:
|
121
134
|
specification_version: 3
|
122
135
|
summary: Provides ISO 3166-1 country codes/names and ISO 4217 currencies.
|