countries 0.2.2 → 0.3.0
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/.gitignore +1 -0
- data/README.markdown +43 -16
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/countries.gemspec +8 -4
- data/lib/countries.rb +6 -54
- data/lib/countries/country.rb +55 -0
- data/lib/data/countries.yaml +4830 -5600
- data/spec/{countries_spec.rb → country_spec.rb} +12 -2
- data/spec/spec_helper.rb +1 -0
- metadata +15 -4
|
@@ -63,7 +63,7 @@ describe Country do
|
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
describe '
|
|
66
|
+
describe 'subdivisions' do
|
|
67
67
|
it 'should return an empty hash for a country with no ISO3166-2' do
|
|
68
68
|
Country.search('VA').subdivisions.should have(0).subdivisions
|
|
69
69
|
end
|
|
@@ -73,9 +73,19 @@ describe Country do
|
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
describe '
|
|
76
|
+
describe 'search' do
|
|
77
77
|
it 'should return new country object when a valid alpha2 is passed' do
|
|
78
78
|
Country.search('US').should be_a(Country)
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
|
+
|
|
82
|
+
describe 'currency' do
|
|
83
|
+
it 'should return an instance of Currency' do
|
|
84
|
+
@country.currency.should be_a(Currency)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it 'should allow access to symbol' do
|
|
88
|
+
@country.currency[:symbol].should == '$'
|
|
89
|
+
end
|
|
90
|
+
end
|
|
81
91
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: countries
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hexorx
|
|
@@ -9,9 +9,19 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2010-02-
|
|
12
|
+
date: 2010-02-19 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: currencies
|
|
17
|
+
type: :runtime
|
|
18
|
+
version_requirement:
|
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 0.2.0
|
|
24
|
+
version:
|
|
15
25
|
- !ruby/object:Gem::Dependency
|
|
16
26
|
name: rspec
|
|
17
27
|
type: :development
|
|
@@ -50,6 +60,7 @@ files:
|
|
|
50
60
|
- VERSION
|
|
51
61
|
- countries.gemspec
|
|
52
62
|
- lib/countries.rb
|
|
63
|
+
- lib/countries/country.rb
|
|
53
64
|
- lib/countries/select_helper.rb
|
|
54
65
|
- lib/data/countries.yaml
|
|
55
66
|
- lib/data/subdivisions/AD.yaml
|
|
@@ -247,7 +258,7 @@ files:
|
|
|
247
258
|
- lib/data/subdivisions/ZA.yaml
|
|
248
259
|
- lib/data/subdivisions/ZM.yaml
|
|
249
260
|
- lib/data/subdivisions/ZW.yaml
|
|
250
|
-
- spec/
|
|
261
|
+
- spec/country_spec.rb
|
|
251
262
|
- spec/spec_helper.rb
|
|
252
263
|
has_rdoc: true
|
|
253
264
|
homepage: http://github.com/hexorx/countries
|
|
@@ -278,5 +289,5 @@ signing_key:
|
|
|
278
289
|
specification_version: 3
|
|
279
290
|
summary: Gives you a country object full of all sorts of useful information.
|
|
280
291
|
test_files:
|
|
281
|
-
- spec/
|
|
292
|
+
- spec/country_spec.rb
|
|
282
293
|
- spec/spec_helper.rb
|