country_select 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,314 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ country_select (3.0.0)
5
+ countries (~> 2.0)
6
+ sort_alphabetical (~> 1.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (5.1.2)
12
+ actionview (= 5.1.2)
13
+ activesupport (= 5.1.2)
14
+ rack (~> 2.0)
15
+ rack-test (~> 0.6.3)
16
+ rails-dom-testing (~> 2.0)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (5.1.2)
19
+ activesupport (= 5.1.2)
20
+ builder (~> 3.1)
21
+ erubi (~> 1.4)
22
+ rails-dom-testing (~> 2.0)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activesupport (5.1.2)
25
+ concurrent-ruby (~> 1.0, >= 1.0.2)
26
+ i18n (~> 0.7)
27
+ minitest (~> 5.1)
28
+ tzinfo (~> 1.1)
29
+ builder (3.2.3)
30
+ coderay (1.1.1)
31
+ concurrent-ruby (1.0.5)
32
+ countries (2.0.8)
33
+ i18n_data (~> 0.7.0)
34
+ money (~> 6.7)
35
+ sixarm_ruby_unaccent (~> 1.1)
36
+ unicode_utils (~> 1.4)
37
+ diff-lcs (1.3)
38
+ erubi (1.6.1)
39
+ ffi2-generators (0.1.1)
40
+ i18n (0.8.6)
41
+ i18n_data (0.7.0)
42
+ loofah (2.0.3)
43
+ nokogiri (>= 1.5.9)
44
+ method_source (0.8.2)
45
+ mini_portile2 (2.2.0)
46
+ minitest (5.10.2)
47
+ money (6.9.0)
48
+ i18n (>= 0.6.4, < 0.9)
49
+ nokogiri (1.8.0)
50
+ mini_portile2 (~> 2.2.0)
51
+ pry (0.10.4)
52
+ coderay (~> 1.1.0)
53
+ method_source (~> 0.8.1)
54
+ slop (~> 3.4)
55
+ psych (2.2.4)
56
+ racc (1.4.14)
57
+ rack (2.0.3)
58
+ rack-test (0.6.3)
59
+ rack (>= 1.0)
60
+ rails-dom-testing (2.0.3)
61
+ activesupport (>= 4.2.0)
62
+ nokogiri (>= 1.6)
63
+ rails-html-sanitizer (1.0.3)
64
+ loofah (~> 2.0)
65
+ railties (5.1.2)
66
+ actionpack (= 5.1.2)
67
+ activesupport (= 5.1.2)
68
+ method_source
69
+ rake (>= 0.8.7)
70
+ thor (>= 0.18.1, < 2.0)
71
+ rake (12.0.0)
72
+ rspec (3.6.0)
73
+ rspec-core (~> 3.6.0)
74
+ rspec-expectations (~> 3.6.0)
75
+ rspec-mocks (~> 3.6.0)
76
+ rspec-core (3.6.0)
77
+ rspec-support (~> 3.6.0)
78
+ rspec-expectations (3.6.0)
79
+ diff-lcs (>= 1.2.0, < 2.0)
80
+ rspec-support (~> 3.6.0)
81
+ rspec-mocks (3.6.0)
82
+ diff-lcs (>= 1.2.0, < 2.0)
83
+ rspec-support (~> 3.6.0)
84
+ rspec-support (3.6.0)
85
+ rubysl (2.2.0)
86
+ rubysl-abbrev (~> 2.0)
87
+ rubysl-base64 (~> 2.0)
88
+ rubysl-benchmark (~> 2.0)
89
+ rubysl-bigdecimal (~> 2.0)
90
+ rubysl-cgi (~> 2.0)
91
+ rubysl-cgi-session (~> 2.0)
92
+ rubysl-cmath (~> 2.0)
93
+ rubysl-complex (~> 2.0)
94
+ rubysl-continuation (~> 2.0)
95
+ rubysl-coverage (~> 2.0)
96
+ rubysl-csv (~> 2.0)
97
+ rubysl-curses (~> 2.0)
98
+ rubysl-date (~> 2.0)
99
+ rubysl-delegate (~> 2.0)
100
+ rubysl-digest (~> 2.0)
101
+ rubysl-drb (~> 2.0)
102
+ rubysl-e2mmap (~> 2.0)
103
+ rubysl-english (~> 2.0)
104
+ rubysl-enumerator (~> 2.0)
105
+ rubysl-erb (~> 2.0)
106
+ rubysl-etc (~> 2.0)
107
+ rubysl-expect (~> 2.0)
108
+ rubysl-fcntl (~> 2.0)
109
+ rubysl-fiber (~> 2.0)
110
+ rubysl-fileutils (~> 2.0)
111
+ rubysl-find (~> 2.0)
112
+ rubysl-forwardable (~> 2.0)
113
+ rubysl-getoptlong (~> 2.0)
114
+ rubysl-gserver (~> 2.0)
115
+ rubysl-io-console (~> 2.0)
116
+ rubysl-io-nonblock (~> 2.0)
117
+ rubysl-io-wait (~> 2.0)
118
+ rubysl-ipaddr (~> 2.0)
119
+ rubysl-irb (~> 2.1)
120
+ rubysl-logger (~> 2.0)
121
+ rubysl-mathn (~> 2.0)
122
+ rubysl-matrix (~> 2.0)
123
+ rubysl-mkmf (~> 2.0)
124
+ rubysl-monitor (~> 2.0)
125
+ rubysl-mutex_m (~> 2.0)
126
+ rubysl-net-ftp (~> 2.0)
127
+ rubysl-net-http (~> 2.0)
128
+ rubysl-net-imap (~> 2.0)
129
+ rubysl-net-pop (~> 2.0)
130
+ rubysl-net-protocol (~> 2.0)
131
+ rubysl-net-smtp (~> 2.0)
132
+ rubysl-net-telnet (~> 2.0)
133
+ rubysl-nkf (~> 2.0)
134
+ rubysl-observer (~> 2.0)
135
+ rubysl-open-uri (~> 2.0)
136
+ rubysl-open3 (~> 2.0)
137
+ rubysl-openssl (~> 2.0)
138
+ rubysl-optparse (~> 2.0)
139
+ rubysl-ostruct (~> 2.0)
140
+ rubysl-pathname (~> 2.0)
141
+ rubysl-prettyprint (~> 2.0)
142
+ rubysl-prime (~> 2.0)
143
+ rubysl-profile (~> 2.0)
144
+ rubysl-profiler (~> 2.0)
145
+ rubysl-pstore (~> 2.0)
146
+ rubysl-pty (~> 2.0)
147
+ rubysl-rational (~> 2.0)
148
+ rubysl-resolv (~> 2.0)
149
+ rubysl-rexml (~> 2.0)
150
+ rubysl-rinda (~> 2.0)
151
+ rubysl-rss (~> 2.0)
152
+ rubysl-scanf (~> 2.0)
153
+ rubysl-securerandom (~> 2.0)
154
+ rubysl-set (~> 2.0)
155
+ rubysl-shellwords (~> 2.0)
156
+ rubysl-singleton (~> 2.0)
157
+ rubysl-socket (~> 2.0)
158
+ rubysl-stringio (~> 2.0)
159
+ rubysl-strscan (~> 2.0)
160
+ rubysl-sync (~> 2.0)
161
+ rubysl-syslog (~> 2.0)
162
+ rubysl-tempfile (~> 2.0)
163
+ rubysl-thread (~> 2.0)
164
+ rubysl-thwait (~> 2.0)
165
+ rubysl-time (~> 2.0)
166
+ rubysl-timeout (~> 2.0)
167
+ rubysl-tmpdir (~> 2.0)
168
+ rubysl-tsort (~> 2.0)
169
+ rubysl-un (~> 2.0)
170
+ rubysl-unicode_normalize (~> 2.0)
171
+ rubysl-uri (~> 2.0)
172
+ rubysl-weakref (~> 2.0)
173
+ rubysl-webrick (~> 2.0)
174
+ rubysl-xmlrpc (~> 2.0)
175
+ rubysl-yaml (~> 2.0)
176
+ rubysl-zlib (~> 2.0)
177
+ rubysl-abbrev (2.0.4)
178
+ rubysl-base64 (2.0.0)
179
+ rubysl-benchmark (2.0.1)
180
+ rubysl-bigdecimal (2.0.2)
181
+ rubysl-cgi (2.0.1)
182
+ rubysl-cgi-session (2.1.0)
183
+ rubysl-cmath (2.0.0)
184
+ rubysl-complex (2.0.0)
185
+ rubysl-continuation (2.0.0)
186
+ rubysl-coverage (2.1)
187
+ rubysl-csv (2.0.2)
188
+ rubysl-english (~> 2.0)
189
+ rubysl-curses (2.0.1)
190
+ rubysl-date (2.0.9)
191
+ rubysl-delegate (2.0.1)
192
+ rubysl-digest (2.0.8)
193
+ rubysl-drb (2.0.1)
194
+ rubysl-e2mmap (2.0.0)
195
+ rubysl-english (2.0.0)
196
+ rubysl-enumerator (2.0.0)
197
+ rubysl-erb (2.0.2)
198
+ rubysl-etc (2.0.3)
199
+ ffi2-generators (~> 0.1)
200
+ rubysl-expect (2.0.0)
201
+ rubysl-fcntl (2.0.4)
202
+ ffi2-generators (~> 0.1)
203
+ rubysl-fiber (2.0.0)
204
+ rubysl-fileutils (2.0.3)
205
+ rubysl-find (2.0.1)
206
+ rubysl-forwardable (2.0.1)
207
+ rubysl-getoptlong (2.0.0)
208
+ rubysl-gserver (2.0.0)
209
+ rubysl-socket (~> 2.0)
210
+ rubysl-thread (~> 2.0)
211
+ rubysl-io-console (2.0.0)
212
+ rubysl-io-nonblock (2.0.0)
213
+ rubysl-io-wait (2.0.0)
214
+ rubysl-ipaddr (2.0.0)
215
+ rubysl-irb (2.1.1)
216
+ rubysl-e2mmap (~> 2.0)
217
+ rubysl-mathn (~> 2.0)
218
+ rubysl-thread (~> 2.0)
219
+ rubysl-logger (2.1.0)
220
+ rubysl-mathn (2.0.0)
221
+ rubysl-matrix (2.1.0)
222
+ rubysl-e2mmap (~> 2.0)
223
+ rubysl-mkmf (2.1)
224
+ rubysl-fileutils (~> 2.0)
225
+ rubysl-shellwords (~> 2.0)
226
+ rubysl-monitor (2.0.0)
227
+ rubysl-mutex_m (2.0.0)
228
+ rubysl-net-ftp (2.0.1)
229
+ rubysl-net-http (2.0.4)
230
+ rubysl-cgi (~> 2.0)
231
+ rubysl-erb (~> 2.0)
232
+ rubysl-singleton (~> 2.0)
233
+ rubysl-net-imap (2.0.1)
234
+ rubysl-net-pop (2.0.1)
235
+ rubysl-net-protocol (2.0.1)
236
+ rubysl-net-smtp (2.0.1)
237
+ rubysl-net-telnet (2.0.0)
238
+ rubysl-nkf (2.0.1)
239
+ rubysl-observer (2.0.0)
240
+ rubysl-open-uri (2.0.0)
241
+ rubysl-open3 (2.0.0)
242
+ rubysl-openssl (2.9)
243
+ rubysl-optparse (2.0.1)
244
+ rubysl-shellwords (~> 2.0)
245
+ rubysl-ostruct (2.1.0)
246
+ rubysl-pathname (2.3)
247
+ rubysl-prettyprint (2.0.3)
248
+ rubysl-prime (2.0.1)
249
+ rubysl-profile (2.0.0)
250
+ rubysl-profiler (2.1)
251
+ rubysl-pstore (2.0.0)
252
+ rubysl-pty (2.0.3)
253
+ rubysl-rational (2.0.1)
254
+ rubysl-resolv (2.1.2)
255
+ rubysl-rexml (2.0.4)
256
+ rubysl-rinda (2.0.1)
257
+ rubysl-rss (2.0.0)
258
+ rubysl-scanf (2.0.0)
259
+ rubysl-securerandom (2.0.0)
260
+ rubysl-set (2.0.1)
261
+ rubysl-shellwords (2.0.0)
262
+ rubysl-singleton (2.0.0)
263
+ rubysl-socket (2.2.1)
264
+ rubysl-fcntl (~> 2.0)
265
+ rubysl-stringio (2.1.0)
266
+ rubysl-strscan (2.0.0)
267
+ rubysl-sync (2.0.0)
268
+ rubysl-syslog (2.1.0)
269
+ ffi2-generators (~> 0.1)
270
+ rubysl-tempfile (2.0.1)
271
+ rubysl-thread (2.0.3)
272
+ rubysl-thwait (2.0.0)
273
+ rubysl-time (2.0.3)
274
+ rubysl-timeout (2.0.0)
275
+ rubysl-tmpdir (2.0.1)
276
+ rubysl-tsort (2.0.1)
277
+ rubysl-un (2.0.0)
278
+ rubysl-fileutils (~> 2.0)
279
+ rubysl-optparse (~> 2.0)
280
+ rubysl-unicode_normalize (2.0)
281
+ rubysl-uri (2.0.0)
282
+ rubysl-weakref (2.0.0)
283
+ rubysl-webrick (2.0.0)
284
+ rubysl-xmlrpc (2.0.0)
285
+ rubysl-yaml (2.1.0)
286
+ rubysl-zlib (2.0.1)
287
+ sixarm_ruby_unaccent (1.1.2)
288
+ slop (3.6.0)
289
+ sort_alphabetical (1.1.0)
290
+ unicode_utils (>= 1.2.2)
291
+ thor (0.19.4)
292
+ thread_safe (0.3.6)
293
+ tzinfo (1.2.3)
294
+ thread_safe (~> 0.1)
295
+ unicode_utils (1.4.0)
296
+ wwtd (1.3.0)
297
+
298
+ PLATFORMS
299
+ ruby
300
+
301
+ DEPENDENCIES
302
+ actionpack (~> 5.1.1)
303
+ country_select!
304
+ pry (~> 0)
305
+ psych
306
+ racc
307
+ railties (~> 5.1.1)
308
+ rake
309
+ rspec (~> 3)
310
+ rubysl (~> 2.0)
311
+ wwtd
312
+
313
+ BUNDLED WITH
314
+ 1.15.1
@@ -89,7 +89,11 @@ module CountrySelect
89
89
  end
90
90
 
91
91
  if sorted
92
- country_list.sort_alphabetical
92
+ if country_list.respond_to?(:sort_alphabetical)
93
+ country_list.sort_alphabetical
94
+ else
95
+ country_list.sort
96
+ end
93
97
  else
94
98
  country_list
95
99
  end
@@ -1,3 +1,3 @@
1
1
  module CountrySelect
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0"
3
3
  end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+
3
+ require 'countries'
4
+
5
+ require 'country_select/version'
6
+ require 'country_select/formats'
7
+ require 'country_select/tag_helper'
8
+
9
+ if defined?(ActionView::Helpers::Tags::Base)
10
+ require 'country_select/country_select_helper'
11
+ else
12
+ require 'country_select/rails3/country_select_helper'
13
+ end
@@ -195,6 +195,23 @@ describe "CountrySelect" do
195
195
  expect(order).to eq(['AF', 'AX', 'AL', 'ZW'])
196
196
  end
197
197
 
198
+ context "without sort_alphabetical" do
199
+ before do
200
+ Enumerable.send(:alias_method, :_sort_alphabetical, :sort_alphabetical)
201
+ Enumerable.send(:remove_method, :sort_alphabetical)
202
+ end
203
+
204
+ after do
205
+ Enumerable.send(:alias_method, :sort_alphabetical, :_sort_alphabetical)
206
+ end
207
+
208
+ it 'falls back to regular sort' do
209
+ tag = builder.country_select(:country_code, only: ['AX', 'AL', 'AF', 'ZW'])
210
+ order = tag.scan(/value="(\w{2})"/).map { |o| o[0] }
211
+ expect(order).to eq(['AF', 'AL', 'ZW', 'AX'])
212
+ end
213
+ end
214
+
198
215
  describe "custom formats" do
199
216
  it "accepts a custom formatter" do
200
217
  ::CountrySelect::FORMATS[:with_alpha2] = lambda do |country|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: country_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Penner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-25 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -140,12 +140,15 @@ files:
140
140
  - gemfiles/actionpack4.2.gemfile.lock
141
141
  - gemfiles/actionpack5.0.gemfile
142
142
  - gemfiles/actionpack5.0.gemfile.lock
143
+ - gemfiles/actionpack5.1.gemfile
144
+ - gemfiles/actionpack5.1.gemfile.lock
143
145
  - lib/country_select.rb
144
146
  - lib/country_select/country_select_helper.rb
145
147
  - lib/country_select/formats.rb
146
148
  - lib/country_select/rails3/country_select_helper.rb
147
149
  - lib/country_select/tag_helper.rb
148
150
  - lib/country_select/version.rb
151
+ - lib/country_select_without_sort_alphabetical.rb
149
152
  - spec/country_select_spec.rb
150
153
  - spec/spec_helper.rb
151
154
  homepage: https://github.com/stefanpenner/country_select
@@ -168,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
171
  version: '0'
169
172
  requirements: []
170
173
  rubyforge_project: country_select
171
- rubygems_version: 2.5.2
174
+ rubygems_version: 2.6.11
172
175
  signing_key:
173
176
  specification_version: 4
174
177
  summary: Country Select Plugin