countries 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm ruby@countries
1
+ rvm use ruby-1.9.3@countries --create
data/Gemfile CHANGED
@@ -1,10 +1,7 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
+ gem "rake"
2
3
 
3
- gem 'currencies', '=0.4.0', :require => 'iso4217'
4
+ # Specify your gem's dependencies in countries.gemspec
5
+ gemspec
4
6
 
5
- group :development, :test do
6
- gem 'jeweler', '>=1.6.4'
7
- gem 'rspec', '=1.3.1'
8
- gem 'rake', '0.8.7'
9
- gem 'yard', '=0.6.4'
10
- end
7
+ gem "currencies", :git => "git://github.com/dwilkie/currencies.git"
@@ -1,22 +1,36 @@
1
- GEM
2
- remote: http://rubygems.org/
1
+ GIT
2
+ remote: git://github.com/dwilkie/currencies.git
3
+ revision: f6da599e6a6d74b2588806498111970e8dbed090
3
4
  specs:
4
5
  currencies (0.4.0)
5
- git (1.2.5)
6
- jeweler (1.6.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- rake (0.8.7)
11
- rspec (1.3.1)
6
+
7
+ PATH
8
+ remote: .
9
+ specs:
10
+ countries (0.8.3)
11
+ currencies (>= 0.4.0)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ diff-lcs (1.1.3)
17
+ rake (0.9.2.2)
18
+ rspec (2.10.0)
19
+ rspec-core (~> 2.10.0)
20
+ rspec-expectations (~> 2.10.0)
21
+ rspec-mocks (~> 2.10.0)
22
+ rspec-core (2.10.0)
23
+ rspec-expectations (2.10.0)
24
+ diff-lcs (~> 1.1.3)
25
+ rspec-mocks (2.10.1)
12
26
  yard (0.6.4)
13
27
 
14
28
  PLATFORMS
15
29
  ruby
16
30
 
17
31
  DEPENDENCIES
18
- currencies (= 0.4.0)
19
- jeweler (>= 1.6.4)
20
- rake (= 0.8.7)
21
- rspec (= 1.3.1)
22
- yard (= 0.6.4)
32
+ countries!
33
+ currencies!
34
+ rake
35
+ rspec
36
+ yard
data/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2009 hexorx
1
+ Copyright (c) 2012 hexorx
2
+
3
+ MIT License
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,44 +1,12 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "countries"
8
- gem.summary = 'Gives you a country object full of all sorts of useful information.'
9
- gem.description = 'All sorts of useful information about every country packaged as pretty little country objects. It includes data from ISO 3166 (countries and subdivisions), ISO 4217 (currency), and E.164 (phone numbers). As a bonus it even adds a country_select helper to rails projects.'
10
- gem.email = "hexorx@gmail.com"
11
- gem.homepage = "http://github.com/hexorx/countries"
12
- gem.authors = ["hexorx", "Joe Corcoran"]
13
- gem.add_dependency('currencies', '>= 0.2.0')
14
- gem.add_development_dependency "rspec"
15
- gem.add_development_dependency "yard"
16
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
- end
18
- Jeweler::GemcutterTasks.new
19
- rescue LoadError
20
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
21
- end
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
22
3
 
23
- require 'spec/rake/spectask'
24
- Spec::Rake::SpecTask.new(:spec) do |spec|
25
- spec.libs << 'lib' << 'spec'
26
- spec.spec_files = FileList['spec/**/*_spec.rb']
27
- end
4
+ require 'rake'
5
+ require 'rspec/core/rake_task'
28
6
 
29
- Spec::Rake::SpecTask.new(:rcov) do |spec|
30
- spec.libs << 'lib' << 'spec'
31
- spec.pattern = 'spec/**/*_spec.rb'
32
- spec.rcov = true
7
+ desc "Run all examples"
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ t.rspec_opts = %w[--color]
33
10
  end
34
11
 
35
- task :default => :spec
36
-
37
- begin
38
- require 'yard'
39
- YARD::Rake::YardocTask.new
40
- rescue LoadError
41
- task :yardoc do
42
- abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
43
- end
44
- end
12
+ task :default => [:spec]
@@ -1,270 +1,21 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/countries/version', __FILE__)
5
3
 
6
- Gem::Specification.new do |s|
7
- s.name = "countries"
8
- s.version = "0.8.2"
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["hexorx", "Joe Corcoran"]
6
+ gem.email = ["hexorx@gmail.com"]
7
+ gem.description = %q{All sorts of useful information about every country packaged as pretty little country objects. It includes data from ISO 3166}
8
+ gem.summary = %q{Gives you a country object full of all sorts of useful information.}
9
+ gem.homepage = "http://github.com/hexorx/countries"
9
10
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["hexorx", "Joe Corcoran"]
12
- s.date = "2012-03-05"
13
- s.description = "All sorts of useful information about every country packaged as pretty little country objects. It includes data from ISO 3166 (countries and subdivisions), ISO 4217 (currency), and E.164 (phone numbers). As a bonus it even adds a country_select helper to rails projects."
14
- s.email = "hexorx@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.markdown"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rvmrc",
22
- "Gemfile",
23
- "Gemfile.lock",
24
- "LICENSE",
25
- "README.markdown",
26
- "Rakefile",
27
- "VERSION",
28
- "countries.gemspec",
29
- "lib/countries.rb",
30
- "lib/countries/country.rb",
31
- "lib/countries/select_helper.rb",
32
- "lib/data/countries.yaml",
33
- "lib/data/subdivisions/AD.yaml",
34
- "lib/data/subdivisions/AE.yaml",
35
- "lib/data/subdivisions/AF.yaml",
36
- "lib/data/subdivisions/AG.yaml",
37
- "lib/data/subdivisions/AL.yaml",
38
- "lib/data/subdivisions/AM.yaml",
39
- "lib/data/subdivisions/AO.yaml",
40
- "lib/data/subdivisions/AR.yaml",
41
- "lib/data/subdivisions/AT.yaml",
42
- "lib/data/subdivisions/AU.yaml",
43
- "lib/data/subdivisions/AZ.yaml",
44
- "lib/data/subdivisions/BA.yaml",
45
- "lib/data/subdivisions/BB.yaml",
46
- "lib/data/subdivisions/BD.yaml",
47
- "lib/data/subdivisions/BE.yaml",
48
- "lib/data/subdivisions/BF.yaml",
49
- "lib/data/subdivisions/BG.yaml",
50
- "lib/data/subdivisions/BH.yaml",
51
- "lib/data/subdivisions/BI.yaml",
52
- "lib/data/subdivisions/BJ.yaml",
53
- "lib/data/subdivisions/BN.yaml",
54
- "lib/data/subdivisions/BO.yaml",
55
- "lib/data/subdivisions/BR.yaml",
56
- "lib/data/subdivisions/BS.yaml",
57
- "lib/data/subdivisions/BT.yaml",
58
- "lib/data/subdivisions/BW.yaml",
59
- "lib/data/subdivisions/BY.yaml",
60
- "lib/data/subdivisions/BZ.yaml",
61
- "lib/data/subdivisions/CA.yaml",
62
- "lib/data/subdivisions/CD.yaml",
63
- "lib/data/subdivisions/CF.yaml",
64
- "lib/data/subdivisions/CG.yaml",
65
- "lib/data/subdivisions/CH.yaml",
66
- "lib/data/subdivisions/CI.yaml",
67
- "lib/data/subdivisions/CL.yaml",
68
- "lib/data/subdivisions/CM.yaml",
69
- "lib/data/subdivisions/CN.yaml",
70
- "lib/data/subdivisions/CO.yaml",
71
- "lib/data/subdivisions/CR.yaml",
72
- "lib/data/subdivisions/CU.yaml",
73
- "lib/data/subdivisions/CV.yaml",
74
- "lib/data/subdivisions/CY.yaml",
75
- "lib/data/subdivisions/CZ.yaml",
76
- "lib/data/subdivisions/DE.yaml",
77
- "lib/data/subdivisions/DJ.yaml",
78
- "lib/data/subdivisions/DK.yaml",
79
- "lib/data/subdivisions/DM.yaml",
80
- "lib/data/subdivisions/DO.yaml",
81
- "lib/data/subdivisions/DZ.yaml",
82
- "lib/data/subdivisions/EC.yaml",
83
- "lib/data/subdivisions/EE.yaml",
84
- "lib/data/subdivisions/EG.yaml",
85
- "lib/data/subdivisions/EH.yaml",
86
- "lib/data/subdivisions/ER.yaml",
87
- "lib/data/subdivisions/ES.yaml",
88
- "lib/data/subdivisions/ET.yaml",
89
- "lib/data/subdivisions/FI.yaml",
90
- "lib/data/subdivisions/FJ.yaml",
91
- "lib/data/subdivisions/FM.yaml",
92
- "lib/data/subdivisions/FR.yaml",
93
- "lib/data/subdivisions/GA.yaml",
94
- "lib/data/subdivisions/GB.yaml",
95
- "lib/data/subdivisions/GD.yaml",
96
- "lib/data/subdivisions/GE.yaml",
97
- "lib/data/subdivisions/GH.yaml",
98
- "lib/data/subdivisions/GM.yaml",
99
- "lib/data/subdivisions/GN.yaml",
100
- "lib/data/subdivisions/GQ.yaml",
101
- "lib/data/subdivisions/GR.yaml",
102
- "lib/data/subdivisions/GT.yaml",
103
- "lib/data/subdivisions/GW.yaml",
104
- "lib/data/subdivisions/GY.yaml",
105
- "lib/data/subdivisions/HN.yaml",
106
- "lib/data/subdivisions/HR.yaml",
107
- "lib/data/subdivisions/HT.yaml",
108
- "lib/data/subdivisions/HU.yaml",
109
- "lib/data/subdivisions/ID.yaml",
110
- "lib/data/subdivisions/IE.yaml",
111
- "lib/data/subdivisions/IL.yaml",
112
- "lib/data/subdivisions/IN.yaml",
113
- "lib/data/subdivisions/IQ.yaml",
114
- "lib/data/subdivisions/IR.yaml",
115
- "lib/data/subdivisions/IS.yaml",
116
- "lib/data/subdivisions/IT.yaml",
117
- "lib/data/subdivisions/JM.yaml",
118
- "lib/data/subdivisions/JO.yaml",
119
- "lib/data/subdivisions/JP.yaml",
120
- "lib/data/subdivisions/KE.yaml",
121
- "lib/data/subdivisions/KG.yaml",
122
- "lib/data/subdivisions/KH.yaml",
123
- "lib/data/subdivisions/KI.yaml",
124
- "lib/data/subdivisions/KM.yaml",
125
- "lib/data/subdivisions/KN.yaml",
126
- "lib/data/subdivisions/KP.yaml",
127
- "lib/data/subdivisions/KR.yaml",
128
- "lib/data/subdivisions/KW.yaml",
129
- "lib/data/subdivisions/KZ.yaml",
130
- "lib/data/subdivisions/Ky.yaml",
131
- "lib/data/subdivisions/LA.yaml",
132
- "lib/data/subdivisions/LB.yaml",
133
- "lib/data/subdivisions/LI.yaml",
134
- "lib/data/subdivisions/LK.yaml",
135
- "lib/data/subdivisions/LR.yaml",
136
- "lib/data/subdivisions/LS.yaml",
137
- "lib/data/subdivisions/LT.yaml",
138
- "lib/data/subdivisions/LU.yaml",
139
- "lib/data/subdivisions/LV.yaml",
140
- "lib/data/subdivisions/LY.yaml",
141
- "lib/data/subdivisions/MA.yaml",
142
- "lib/data/subdivisions/MD.yaml",
143
- "lib/data/subdivisions/ME.yaml",
144
- "lib/data/subdivisions/MG.yaml",
145
- "lib/data/subdivisions/MH.yaml",
146
- "lib/data/subdivisions/MK.yaml",
147
- "lib/data/subdivisions/ML.yaml",
148
- "lib/data/subdivisions/MM.yaml",
149
- "lib/data/subdivisions/MN.yaml",
150
- "lib/data/subdivisions/MR.yaml",
151
- "lib/data/subdivisions/MU.yaml",
152
- "lib/data/subdivisions/MV.yaml",
153
- "lib/data/subdivisions/MW.yaml",
154
- "lib/data/subdivisions/MX.yaml",
155
- "lib/data/subdivisions/MY.yaml",
156
- "lib/data/subdivisions/MZ.yaml",
157
- "lib/data/subdivisions/NA.yaml",
158
- "lib/data/subdivisions/NE.yaml",
159
- "lib/data/subdivisions/NG.yaml",
160
- "lib/data/subdivisions/NI.yaml",
161
- "lib/data/subdivisions/NL.yaml",
162
- "lib/data/subdivisions/NO.yaml",
163
- "lib/data/subdivisions/NP.yaml",
164
- "lib/data/subdivisions/NR.yaml",
165
- "lib/data/subdivisions/NZ.yaml",
166
- "lib/data/subdivisions/OM.yaml",
167
- "lib/data/subdivisions/PA.yaml",
168
- "lib/data/subdivisions/PE.yaml",
169
- "lib/data/subdivisions/PG.yaml",
170
- "lib/data/subdivisions/PH.yaml",
171
- "lib/data/subdivisions/PK.yaml",
172
- "lib/data/subdivisions/PL.yaml",
173
- "lib/data/subdivisions/PT.yaml",
174
- "lib/data/subdivisions/PW.yaml",
175
- "lib/data/subdivisions/PY.yaml",
176
- "lib/data/subdivisions/QA.yaml",
177
- "lib/data/subdivisions/RO.yaml",
178
- "lib/data/subdivisions/RS.yaml",
179
- "lib/data/subdivisions/RU.yaml",
180
- "lib/data/subdivisions/RW.yaml",
181
- "lib/data/subdivisions/SA.yaml",
182
- "lib/data/subdivisions/SB.yaml",
183
- "lib/data/subdivisions/SC.yaml",
184
- "lib/data/subdivisions/SD.yaml",
185
- "lib/data/subdivisions/SE.yaml",
186
- "lib/data/subdivisions/SG.yaml",
187
- "lib/data/subdivisions/SH.yaml",
188
- "lib/data/subdivisions/SI.yaml",
189
- "lib/data/subdivisions/SK.yaml",
190
- "lib/data/subdivisions/SL.yaml",
191
- "lib/data/subdivisions/SM.yaml",
192
- "lib/data/subdivisions/SN.yaml",
193
- "lib/data/subdivisions/SO.yaml",
194
- "lib/data/subdivisions/SR.yaml",
195
- "lib/data/subdivisions/ST.yaml",
196
- "lib/data/subdivisions/SV.yaml",
197
- "lib/data/subdivisions/SY.yaml",
198
- "lib/data/subdivisions/SZ.yaml",
199
- "lib/data/subdivisions/TD.yaml",
200
- "lib/data/subdivisions/TF.yaml",
201
- "lib/data/subdivisions/TG.yaml",
202
- "lib/data/subdivisions/TH.yaml",
203
- "lib/data/subdivisions/TL.yaml",
204
- "lib/data/subdivisions/TM.yaml",
205
- "lib/data/subdivisions/TN.yaml",
206
- "lib/data/subdivisions/TO.yaml",
207
- "lib/data/subdivisions/TR.yaml",
208
- "lib/data/subdivisions/TT.yaml",
209
- "lib/data/subdivisions/TV.yaml",
210
- "lib/data/subdivisions/TW.yaml",
211
- "lib/data/subdivisions/TZ.yaml",
212
- "lib/data/subdivisions/Tj.yaml",
213
- "lib/data/subdivisions/UA.yaml",
214
- "lib/data/subdivisions/UG.yaml",
215
- "lib/data/subdivisions/UM.yaml",
216
- "lib/data/subdivisions/US.yaml",
217
- "lib/data/subdivisions/UY.yaml",
218
- "lib/data/subdivisions/UZ.yaml",
219
- "lib/data/subdivisions/VC.yaml",
220
- "lib/data/subdivisions/VE.yaml",
221
- "lib/data/subdivisions/VN.yaml",
222
- "lib/data/subdivisions/VU.yaml",
223
- "lib/data/subdivisions/WS.yaml",
224
- "lib/data/subdivisions/YE.yaml",
225
- "lib/data/subdivisions/ZA.yaml",
226
- "lib/data/subdivisions/ZM.yaml",
227
- "lib/data/subdivisions/ZW.yaml",
228
- "lib/iso3166.rb",
229
- "spec/country_spec.rb",
230
- "spec/spec_helper.rb"
231
- ]
232
- s.homepage = "http://github.com/hexorx/countries"
233
- s.require_paths = ["lib"]
234
- s.rubygems_version = "1.8.10"
235
- s.summary = "Gives you a country object full of all sorts of useful information."
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "countries"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Countries::VERSION
236
17
 
237
- if s.respond_to? :specification_version then
238
- s.specification_version = 3
239
-
240
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
241
- s.add_runtime_dependency(%q<currencies>, ["= 0.4.0"])
242
- s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
243
- s.add_development_dependency(%q<rspec>, ["= 1.3.1"])
244
- s.add_development_dependency(%q<rake>, ["= 0.8.7"])
245
- s.add_development_dependency(%q<yard>, ["= 0.6.4"])
246
- s.add_runtime_dependency(%q<currencies>, [">= 0.2.0"])
247
- s.add_development_dependency(%q<rspec>, [">= 0"])
248
- s.add_development_dependency(%q<yard>, [">= 0"])
249
- else
250
- s.add_dependency(%q<currencies>, ["= 0.4.0"])
251
- s.add_dependency(%q<jeweler>, [">= 1.6.4"])
252
- s.add_dependency(%q<rspec>, ["= 1.3.1"])
253
- s.add_dependency(%q<rake>, ["= 0.8.7"])
254
- s.add_dependency(%q<yard>, ["= 0.6.4"])
255
- s.add_dependency(%q<currencies>, [">= 0.2.0"])
256
- s.add_dependency(%q<rspec>, [">= 0"])
257
- s.add_dependency(%q<yard>, [">= 0"])
258
- end
259
- else
260
- s.add_dependency(%q<currencies>, ["= 0.4.0"])
261
- s.add_dependency(%q<jeweler>, [">= 1.6.4"])
262
- s.add_dependency(%q<rspec>, ["= 1.3.1"])
263
- s.add_dependency(%q<rake>, ["= 0.8.7"])
264
- s.add_dependency(%q<yard>, ["= 0.6.4"])
265
- s.add_dependency(%q<currencies>, [">= 0.2.0"])
266
- s.add_dependency(%q<rspec>, [">= 0"])
267
- s.add_dependency(%q<yard>, [">= 0"])
268
- end
18
+ gem.add_dependency('currencies', '>= 0.4.0')
19
+ gem.add_development_dependency "rspec"
20
+ gem.add_development_dependency "yard"
269
21
  end
270
-
@@ -1,5 +1,6 @@
1
- $LOAD_PATH << File.expand_path(File.dirname(__FILE__))
1
+ require "countries/version"
2
2
 
3
3
  require 'iso3166'
4
4
 
5
- class Country < ISO3166::Country; end
5
+ class Country < ISO3166::Country
6
+ end
@@ -23,7 +23,8 @@ class ISO3166::Country
23
23
  :national_prefix,
24
24
  :address_format,
25
25
  :ioc,
26
- :un_locode
26
+ :un_locode,
27
+ :languages
27
28
  ]
28
29
 
29
30
  AttrReaders.each do |meth|
@@ -42,6 +43,10 @@ class ISO3166::Country
42
43
  !!@data
43
44
  end
44
45
 
46
+ def ==(other)
47
+ self.data == other.data
48
+ end
49
+
45
50
  def currency
46
51
  ISO4217::Currency.from_code(@data['currency'])
47
52
  end