countries 1.2.5 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +6 -2
- data/Gemfile +1 -0
- data/README.markdown +33 -7
- data/Rakefile +15 -20
- data/countries.gemspec +1 -1
- data/lib/countries/cache/countries +0 -0
- data/lib/countries/cache/locales/af +0 -0
- data/lib/countries/cache/locales/am +0 -0
- data/lib/countries/cache/locales/ar +0 -0
- data/lib/countries/cache/locales/as +0 -0
- data/lib/countries/cache/locales/az +0 -0
- data/lib/countries/cache/locales/be +0 -0
- data/lib/countries/cache/locales/bg +0 -0
- data/lib/countries/cache/locales/bn +0 -0
- data/lib/countries/cache/locales/br +0 -0
- data/lib/countries/cache/locales/bs +0 -0
- data/lib/countries/cache/locales/ca +0 -0
- data/lib/countries/cache/locales/cs +0 -0
- data/lib/countries/cache/locales/cy +0 -0
- data/lib/countries/cache/locales/da +0 -0
- data/lib/countries/cache/locales/de +0 -0
- data/lib/countries/cache/locales/dz +0 -0
- data/lib/countries/cache/locales/el +0 -0
- data/lib/countries/cache/locales/en +0 -0
- data/lib/countries/cache/locales/eo +0 -0
- data/lib/countries/cache/locales/es +0 -0
- data/lib/countries/cache/locales/et +0 -0
- data/lib/countries/cache/locales/eu +0 -0
- data/lib/countries/cache/locales/fa +0 -0
- data/lib/countries/cache/locales/fi +0 -0
- data/lib/countries/cache/locales/fo +0 -0
- data/lib/countries/cache/locales/fr +0 -0
- data/lib/countries/cache/locales/ga +0 -0
- data/lib/countries/cache/locales/gl +0 -0
- data/lib/countries/cache/locales/gu +0 -0
- data/lib/countries/cache/locales/he +0 -0
- data/lib/countries/cache/locales/hi +0 -0
- data/lib/countries/cache/locales/hr +0 -0
- data/lib/countries/cache/locales/hu +0 -0
- data/lib/countries/cache/locales/hy +0 -0
- data/lib/countries/cache/locales/ia +0 -0
- data/lib/countries/cache/locales/id +0 -0
- data/lib/countries/cache/locales/is +0 -0
- data/lib/countries/cache/locales/it +0 -0
- data/lib/countries/cache/locales/ja +0 -0
- data/lib/countries/cache/locales/ka +0 -0
- data/lib/countries/cache/locales/kk +0 -0
- data/lib/countries/cache/locales/km +0 -0
- data/lib/countries/cache/locales/kn +0 -0
- data/lib/countries/cache/locales/ko +0 -0
- data/lib/countries/cache/locales/ku +0 -0
- data/lib/countries/cache/locales/lt +0 -0
- data/lib/countries/cache/locales/lv +0 -0
- data/lib/countries/cache/locales/mi +0 -0
- data/lib/countries/cache/locales/mk +0 -0
- data/lib/countries/cache/locales/ml +0 -0
- data/lib/countries/cache/locales/mn +0 -0
- data/lib/countries/cache/locales/mr +0 -0
- data/lib/countries/cache/locales/ms +0 -0
- data/lib/countries/cache/locales/mt +0 -0
- data/lib/countries/cache/locales/nb +0 -0
- data/lib/countries/cache/locales/ne +0 -0
- data/lib/countries/cache/locales/nl +0 -0
- data/lib/countries/cache/locales/nn +0 -0
- data/lib/countries/cache/locales/oc +0 -0
- data/lib/countries/cache/locales/or +0 -0
- data/lib/countries/cache/locales/pa +0 -0
- data/lib/countries/cache/locales/pl +0 -0
- data/lib/countries/cache/locales/ps +0 -0
- data/lib/countries/cache/locales/pt +0 -0
- data/lib/countries/cache/locales/ro +0 -0
- data/lib/countries/cache/locales/ru +0 -0
- data/lib/countries/cache/locales/rw +0 -0
- data/lib/countries/cache/locales/si +0 -0
- data/lib/countries/cache/locales/sk +0 -0
- data/lib/countries/cache/locales/sl +0 -0
- data/lib/countries/cache/locales/so +0 -0
- data/lib/countries/cache/locales/sq +0 -0
- data/lib/countries/cache/locales/sr +0 -0
- data/lib/countries/cache/locales/sv +0 -0
- data/lib/countries/cache/locales/sw +0 -0
- data/lib/countries/cache/locales/ta +0 -0
- data/lib/countries/cache/locales/te +0 -0
- data/lib/countries/cache/locales/th +0 -0
- data/lib/countries/cache/locales/ti +0 -0
- data/lib/countries/cache/locales/tk +0 -0
- data/lib/countries/cache/locales/tl +0 -0
- data/lib/countries/cache/locales/tr +0 -0
- data/lib/countries/cache/locales/tt +0 -0
- data/lib/countries/cache/locales/ug +0 -0
- data/lib/countries/cache/locales/uk +0 -0
- data/lib/countries/cache/locales/ve +0 -0
- data/lib/countries/cache/locales/vi +0 -0
- data/lib/countries/cache/locales/wa +0 -0
- data/lib/countries/cache/locales/wo +0 -0
- data/lib/countries/cache/locales/xh +0 -0
- data/lib/countries/cache/locales/zh +0 -0
- data/lib/countries/cache/locales/zu +0 -0
- data/lib/countries/configuration.rb +37 -0
- data/lib/countries/country.rb +115 -159
- data/lib/countries/country/attr_readers.rb +49 -0
- data/lib/countries/data.rb +76 -13
- data/lib/countries/iso3166.rb +4 -2
- data/lib/countries/setup.rb +7 -7
- data/lib/countries/timezones.rb +11 -0
- data/lib/countries/version.rb +1 -1
- data/spec/configuration_spec.rb +43 -0
- data/spec/country_spec.rb +22 -36
- data/spec/data_spec.rb +73 -0
- data/spec/global_spec.rb +29 -0
- data/spec/mongoid_spec.rb +1 -1
- data/spec/spec_helper.rb +24 -0
- data/spec/timezone_spec.rb +32 -0
- metadata +110 -9
- data/spec/setup_spec.rb +0 -14
data/spec/mongoid_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1 +1,25 @@
|
|
1
1
|
require 'countries'
|
2
|
+
RSpec.configure do |config|
|
3
|
+
|
4
|
+
# config.after(:each) do
|
5
|
+
# ISO3166.reset
|
6
|
+
# end
|
7
|
+
|
8
|
+
config.filter_run :focus
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
|
11
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
12
|
+
|
13
|
+
config.warnings = true
|
14
|
+
|
15
|
+
# if config.files_to_run.one?
|
16
|
+
# config.default_formatter = 'doc'
|
17
|
+
# end
|
18
|
+
|
19
|
+
# config.profile_examples = 10
|
20
|
+
|
21
|
+
# config.order = :random
|
22
|
+
|
23
|
+
# Kernel.srand config.seed
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
describe 'timezone Country class' do
|
2
|
+
context "when loaded via 'timezone'" do
|
3
|
+
require 'tzinfo'
|
4
|
+
describe 'existance' do
|
5
|
+
subject { defined?(TZInfo) }
|
6
|
+
|
7
|
+
it { is_expected.to be_truthy }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe 'GB' do
|
11
|
+
subject { Country.new('GB') }
|
12
|
+
it 'should return the tzinfo country object' do
|
13
|
+
expect(subject.timezones).to be_a(TZInfo::Country)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should return the tzinfo country object' do
|
17
|
+
expect(subject.timezones.zone_info).to be_a(Array)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should return the tzinfo country object' do
|
21
|
+
expect(subject.timezones.zone_identifiers).to eq ['Europe/London']
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'US' do
|
26
|
+
subject { Country.new('US') }
|
27
|
+
it 'should return the tzinfo country object' do
|
28
|
+
expect(subject.timezones.zone_identifiers.size).to eq 29
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
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:
|
4
|
+
version: 2.0.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Robinson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-01-
|
13
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n_data
|
@@ -27,19 +27,19 @@ dependencies:
|
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 0.7.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
30
|
+
name: money
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0
|
35
|
+
version: '6.0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0
|
42
|
+
version: '6.0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rspec
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,7 +102,101 @@ files:
|
|
102
102
|
- countries.gemspec
|
103
103
|
- lib/countries.rb
|
104
104
|
- lib/countries/cache/countries
|
105
|
+
- lib/countries/cache/locales/af
|
106
|
+
- lib/countries/cache/locales/am
|
107
|
+
- lib/countries/cache/locales/ar
|
108
|
+
- lib/countries/cache/locales/as
|
109
|
+
- lib/countries/cache/locales/az
|
110
|
+
- lib/countries/cache/locales/be
|
111
|
+
- lib/countries/cache/locales/bg
|
112
|
+
- lib/countries/cache/locales/bn
|
113
|
+
- lib/countries/cache/locales/br
|
114
|
+
- lib/countries/cache/locales/bs
|
115
|
+
- lib/countries/cache/locales/ca
|
116
|
+
- lib/countries/cache/locales/cs
|
117
|
+
- lib/countries/cache/locales/cy
|
118
|
+
- lib/countries/cache/locales/da
|
119
|
+
- lib/countries/cache/locales/de
|
120
|
+
- lib/countries/cache/locales/dz
|
121
|
+
- lib/countries/cache/locales/el
|
122
|
+
- lib/countries/cache/locales/en
|
123
|
+
- lib/countries/cache/locales/eo
|
124
|
+
- lib/countries/cache/locales/es
|
125
|
+
- lib/countries/cache/locales/et
|
126
|
+
- lib/countries/cache/locales/eu
|
127
|
+
- lib/countries/cache/locales/fa
|
128
|
+
- lib/countries/cache/locales/fi
|
129
|
+
- lib/countries/cache/locales/fo
|
130
|
+
- lib/countries/cache/locales/fr
|
131
|
+
- lib/countries/cache/locales/ga
|
132
|
+
- lib/countries/cache/locales/gl
|
133
|
+
- lib/countries/cache/locales/gu
|
134
|
+
- lib/countries/cache/locales/he
|
135
|
+
- lib/countries/cache/locales/hi
|
136
|
+
- lib/countries/cache/locales/hr
|
137
|
+
- lib/countries/cache/locales/hu
|
138
|
+
- lib/countries/cache/locales/hy
|
139
|
+
- lib/countries/cache/locales/ia
|
140
|
+
- lib/countries/cache/locales/id
|
141
|
+
- lib/countries/cache/locales/is
|
142
|
+
- lib/countries/cache/locales/it
|
143
|
+
- lib/countries/cache/locales/ja
|
144
|
+
- lib/countries/cache/locales/ka
|
145
|
+
- lib/countries/cache/locales/kk
|
146
|
+
- lib/countries/cache/locales/km
|
147
|
+
- lib/countries/cache/locales/kn
|
148
|
+
- lib/countries/cache/locales/ko
|
149
|
+
- lib/countries/cache/locales/ku
|
150
|
+
- lib/countries/cache/locales/lt
|
151
|
+
- lib/countries/cache/locales/lv
|
152
|
+
- lib/countries/cache/locales/mi
|
153
|
+
- lib/countries/cache/locales/mk
|
154
|
+
- lib/countries/cache/locales/ml
|
155
|
+
- lib/countries/cache/locales/mn
|
156
|
+
- lib/countries/cache/locales/mr
|
157
|
+
- lib/countries/cache/locales/ms
|
158
|
+
- lib/countries/cache/locales/mt
|
159
|
+
- lib/countries/cache/locales/nb
|
160
|
+
- lib/countries/cache/locales/ne
|
161
|
+
- lib/countries/cache/locales/nl
|
162
|
+
- lib/countries/cache/locales/nn
|
163
|
+
- lib/countries/cache/locales/oc
|
164
|
+
- lib/countries/cache/locales/or
|
165
|
+
- lib/countries/cache/locales/pa
|
166
|
+
- lib/countries/cache/locales/pl
|
167
|
+
- lib/countries/cache/locales/ps
|
168
|
+
- lib/countries/cache/locales/pt
|
169
|
+
- lib/countries/cache/locales/ro
|
170
|
+
- lib/countries/cache/locales/ru
|
171
|
+
- lib/countries/cache/locales/rw
|
172
|
+
- lib/countries/cache/locales/si
|
173
|
+
- lib/countries/cache/locales/sk
|
174
|
+
- lib/countries/cache/locales/sl
|
175
|
+
- lib/countries/cache/locales/so
|
176
|
+
- lib/countries/cache/locales/sq
|
177
|
+
- lib/countries/cache/locales/sr
|
178
|
+
- lib/countries/cache/locales/sv
|
179
|
+
- lib/countries/cache/locales/sw
|
180
|
+
- lib/countries/cache/locales/ta
|
181
|
+
- lib/countries/cache/locales/te
|
182
|
+
- lib/countries/cache/locales/th
|
183
|
+
- lib/countries/cache/locales/ti
|
184
|
+
- lib/countries/cache/locales/tk
|
185
|
+
- lib/countries/cache/locales/tl
|
186
|
+
- lib/countries/cache/locales/tr
|
187
|
+
- lib/countries/cache/locales/tt
|
188
|
+
- lib/countries/cache/locales/ug
|
189
|
+
- lib/countries/cache/locales/uk
|
190
|
+
- lib/countries/cache/locales/ve
|
191
|
+
- lib/countries/cache/locales/vi
|
192
|
+
- lib/countries/cache/locales/wa
|
193
|
+
- lib/countries/cache/locales/wo
|
194
|
+
- lib/countries/cache/locales/xh
|
195
|
+
- lib/countries/cache/locales/zh
|
196
|
+
- lib/countries/cache/locales/zu
|
197
|
+
- lib/countries/configuration.rb
|
105
198
|
- lib/countries/country.rb
|
199
|
+
- lib/countries/country/attr_readers.rb
|
106
200
|
- lib/countries/data.rb
|
107
201
|
- lib/countries/data/countries.yaml
|
108
202
|
- lib/countries/data/countries/AD.yaml
|
@@ -557,11 +651,15 @@ files:
|
|
557
651
|
- lib/countries/iso3166.rb
|
558
652
|
- lib/countries/mongoid.rb
|
559
653
|
- lib/countries/setup.rb
|
654
|
+
- lib/countries/timezones.rb
|
560
655
|
- lib/countries/version.rb
|
656
|
+
- spec/configuration_spec.rb
|
561
657
|
- spec/country_spec.rb
|
658
|
+
- spec/data_spec.rb
|
659
|
+
- spec/global_spec.rb
|
562
660
|
- spec/mongoid_spec.rb
|
563
|
-
- spec/setup_spec.rb
|
564
661
|
- spec/spec_helper.rb
|
662
|
+
- spec/timezone_spec.rb
|
565
663
|
homepage: http://github.com/hexorx/countries
|
566
664
|
licenses: []
|
567
665
|
metadata: {}
|
@@ -576,9 +674,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
576
674
|
version: '0'
|
577
675
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
578
676
|
requirements:
|
579
|
-
- - "
|
677
|
+
- - ">"
|
580
678
|
- !ruby/object:Gem::Version
|
581
|
-
version:
|
679
|
+
version: 1.3.1
|
582
680
|
requirements: []
|
583
681
|
rubyforge_project:
|
584
682
|
rubygems_version: 2.4.5.1
|
@@ -586,8 +684,11 @@ signing_key:
|
|
586
684
|
specification_version: 4
|
587
685
|
summary: Gives you a country object full of all sorts of useful information.
|
588
686
|
test_files:
|
687
|
+
- spec/configuration_spec.rb
|
589
688
|
- spec/country_spec.rb
|
689
|
+
- spec/data_spec.rb
|
690
|
+
- spec/global_spec.rb
|
590
691
|
- spec/mongoid_spec.rb
|
591
|
-
- spec/setup_spec.rb
|
592
692
|
- spec/spec_helper.rb
|
693
|
+
- spec/timezone_spec.rb
|
593
694
|
has_rdoc:
|
data/spec/setup_spec.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
3
|
-
|
4
|
-
describe ISO3166::Setup do
|
5
|
-
it 'responds to codes' do
|
6
|
-
setup = ISO3166::Setup.new
|
7
|
-
expect(setup.codes).to be_a Array
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'responds to data' do
|
11
|
-
setup = ISO3166::Setup.new
|
12
|
-
expect(setup.data).to be_a Hash
|
13
|
-
end
|
14
|
-
end
|