listings 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 32776ce178fcb720c00b4934b817b1caf3074944
4
+ data.tar.gz: 580d72bd4ab37f34a8e1547f25d0754bb296d429
5
+ SHA512:
6
+ metadata.gz: 7206e2c4df8f2213ceab30455446de291e9cce3700b612e7e864fee6308cfb806456b0d4486d8735b51740991f7a987a449fea761338b073b3fe032df4a43665
7
+ data.tar.gz: 568d4deb9319ff9dc18877b471f0e09a768445e529f804e5349ebf48a3b4cd255c5892573605b177a095fac1d69064bbabe01f56bc27ac39ff087bc5be6d9c10
@@ -38,7 +38,7 @@ module Listings
38
38
  if !paging
39
39
  listing.page_size = :none
40
40
  end
41
- listing.query_items(params)
41
+ listing.query_items(params.respond_to?(:to_unsafe_h) ? params.to_unsafe_h : params)
42
42
  end
43
43
  end
44
44
 
@@ -40,7 +40,11 @@ module RSpec::ListingsHelpers
40
40
  controller.request = if Rails::VERSION::MAJOR < 5
41
41
  ActionController::TestRequest.new(:host => "http://test.com")
42
42
  else
43
- ActionController::TestRequest.create
43
+ if Rails::VERSION::MINOR >= 1 # ~> 5.1
44
+ ActionController::TestRequest.create(controller.class)
45
+ else
46
+ ActionController::TestRequest.create
47
+ end
44
48
  end
45
49
  context = controller.view_context
46
50
 
@@ -1,3 +1,3 @@
1
1
  module Listings
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.10"
3
3
  end
@@ -22,11 +22,19 @@ module Listings
22
22
  # TODO add url_for_filter that will build the search string
23
23
 
24
24
  def build_params(more_params)
25
- res = view_context.params.merge(:listing => self.name).merge(params).merge(more_params)
25
+ res = _to_unsafe_h(view_context.params).merge(:listing => self.name).merge(_to_unsafe_h(params)).merge(more_params)
26
26
  res.delete param_page
27
27
  res.delete :controller
28
28
  res.delete :action
29
- Rails::VERSION::MAJOR < 5 ? res.with_indifferent_access : res.to_unsafe_h
29
+ _to_unsafe_h(res).with_indifferent_access
30
+ end
31
+
32
+ def _to_unsafe_h(hsh)
33
+ if hsh.respond_to?(:to_unsafe_h)
34
+ hsh.to_unsafe_h
35
+ else
36
+ hsh
37
+ end
30
38
  end
31
39
 
32
40
  def no_data_message
@@ -1,7 +1,13 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
3
 
4
- before_filter do
5
- Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
4
+ if Rails::VERSION::MAJOR < 5
5
+ before_filter do
6
+ Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
7
+ end
8
+ else
9
+ before_action do
10
+ Listings.configuration.theme = params[:theme] || Listings::Configuration.new.theme
11
+ end
6
12
  end
7
13
  end
data/spec/dummy/spec ADDED
@@ -0,0 +1 @@
1
+ spec/dummy/../../spec
metadata CHANGED
@@ -1,142 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
5
- prerelease:
4
+ version: 0.1.10
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brian J. Cardiff
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-05-09 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: haml-rails
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sass-rails
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: kaminari
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: bootstrap-kaminari-views
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: sqlite3
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rspec-rails
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: factory_girl_rails
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - ">="
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - ">="
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  description: Simple creation of listings in rails applications.
@@ -146,11 +129,14 @@ executables: []
146
129
  extensions: []
147
130
  extra_rdoc_files: []
148
131
  files:
132
+ - LICENSE
133
+ - README.md
134
+ - Rakefile
149
135
  - app/assets/javascripts/jquery-throttle.js
150
- - app/assets/javascripts/listings/application.js
151
136
  - app/assets/javascripts/listings.js
152
- - app/assets/stylesheets/listings/application.css
137
+ - app/assets/javascripts/listings/application.js
153
138
  - app/assets/stylesheets/listings.scss
139
+ - app/assets/stylesheets/listings/application.css
154
140
  - app/controllers/listings/application_controller.rb
155
141
  - app/controllers/listings/listings_controller.rb
156
142
  - app/helpers/listings/application_helper.rb
@@ -174,6 +160,7 @@ files:
174
160
  - app/views/listings/twitter-bootstrap-3/_top_filter.html.haml
175
161
  - config/locales/listings.yml
176
162
  - config/routes.rb
163
+ - lib/listings.rb
177
164
  - lib/listings/action_view_extensions.rb
178
165
  - lib/listings/base.rb
179
166
  - lib/listings/base_field_descriptor.rb
@@ -190,20 +177,18 @@ files:
190
177
  - lib/listings/filter_view.rb
191
178
  - lib/listings/filters/base.rb
192
179
  - lib/listings/kaminari_helpers_tag_patch.rb
193
- - lib/listings/rspec/listings_helpers.rb
194
180
  - lib/listings/rspec.rb
181
+ - lib/listings/rspec/listings_helpers.rb
195
182
  - lib/listings/scope_descriptor.rb
183
+ - lib/listings/sources.rb
196
184
  - lib/listings/sources/active_record_data_source.rb
197
185
  - lib/listings/sources/data_source.rb
198
186
  - lib/listings/sources/object_data_source.rb
199
- - lib/listings/sources.rb
200
187
  - lib/listings/version.rb
201
188
  - lib/listings/view_helper_methods.rb
202
- - lib/listings.rb
203
189
  - lib/tasks/listings_tasks.rake
204
- - LICENSE
205
- - Rakefile
206
- - README.md
190
+ - spec/dummy/README.rdoc
191
+ - spec/dummy/Rakefile
207
192
  - spec/dummy/app/assets/javascripts/application.js
208
193
  - spec/dummy/app/assets/stylesheets/application.css
209
194
  - spec/dummy/app/controllers/application_controller.rb
@@ -231,6 +216,7 @@ files:
231
216
  - spec/dummy/app/views/welcome/hash.html.haml
232
217
  - spec/dummy/app/views/welcome/index.html.haml
233
218
  - spec/dummy/app/views/welcome/tracks.html.haml
219
+ - spec/dummy/config.ru
234
220
  - spec/dummy/config/application.rb
235
221
  - spec/dummy/config/boot.rb
236
222
  - spec/dummy/config/database.yml
@@ -247,7 +233,6 @@ files:
247
233
  - spec/dummy/config/initializers/wrap_parameters.rb
248
234
  - spec/dummy/config/locales/en.yml
249
235
  - spec/dummy/config/routes.rb
250
- - spec/dummy/config.ru
251
236
  - spec/dummy/db/migrate/20130618143317_create_posts.rb
252
237
  - spec/dummy/db/migrate/20130618195559_add_author_to_posts.rb
253
238
  - spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
@@ -259,9 +244,8 @@ files:
259
244
  - spec/dummy/public/422.html
260
245
  - spec/dummy/public/500.html
261
246
  - spec/dummy/public/favicon.ico
262
- - spec/dummy/Rakefile
263
- - spec/dummy/README.rdoc
264
247
  - spec/dummy/script/rails
248
+ - spec/dummy/spec
265
249
  - spec/factories/albums.rb
266
250
  - spec/factories/post.rb
267
251
  - spec/factories/tracks.rb
@@ -279,99 +263,99 @@ files:
279
263
  - spec/support/query_counter.rb
280
264
  homepage: https://github.com/manastech/listings
281
265
  licenses: []
266
+ metadata: {}
282
267
  post_install_message:
283
268
  rdoc_options: []
284
269
  require_paths:
285
270
  - lib
286
271
  required_ruby_version: !ruby/object:Gem::Requirement
287
- none: false
288
272
  requirements:
289
- - - ! '>='
273
+ - - ">="
290
274
  - !ruby/object:Gem::Version
291
275
  version: '0'
292
276
  required_rubygems_version: !ruby/object:Gem::Requirement
293
- none: false
294
277
  requirements:
295
- - - ! '>='
278
+ - - ">="
296
279
  - !ruby/object:Gem::Version
297
280
  version: '0'
298
281
  requirements: []
299
282
  rubyforge_project:
300
- rubygems_version: 1.8.23.2
283
+ rubygems_version: 2.6.12
301
284
  signing_key:
302
- specification_version: 3
285
+ specification_version: 4
303
286
  summary: Simple creation of listings in rails applications.
304
287
  test_files:
305
- - spec/dummy/app/assets/javascripts/application.js
306
- - spec/dummy/app/assets/stylesheets/application.css
307
- - spec/dummy/app/controllers/application_controller.rb
308
- - spec/dummy/app/controllers/posts_controller.rb
309
- - spec/dummy/app/controllers/welcome_controller.rb
310
- - spec/dummy/app/helpers/application_helper.rb
311
- - spec/dummy/app/helpers/posts_helper.rb
312
- - spec/dummy/app/listings/array_listing.rb
288
+ - spec/spec_helper.rb
313
289
  - spec/dummy/app/listings/filtered_posts_listing.rb
314
- - spec/dummy/app/listings/hash_listing.rb
315
290
  - spec/dummy/app/listings/posts_listing.rb
316
- - spec/dummy/app/listings/tracks_fixed_order_listing.rb
291
+ - spec/dummy/app/listings/array_listing.rb
292
+ - spec/dummy/app/listings/hash_listing.rb
317
293
  - spec/dummy/app/listings/tracks_listing.rb
294
+ - spec/dummy/app/listings/tracks_fixed_order_listing.rb
295
+ - spec/dummy/app/models/object_track.rb
318
296
  - spec/dummy/app/models/album.rb
319
297
  - spec/dummy/app/models/object_album.rb
320
- - spec/dummy/app/models/object_track.rb
321
- - spec/dummy/app/models/post.rb
322
298
  - spec/dummy/app/models/track.rb
323
- - spec/dummy/app/views/layouts/application.html.erb
324
- - spec/dummy/app/views/listings/_date.html.haml
299
+ - spec/dummy/app/models/post.rb
300
+ - spec/dummy/app/controllers/application_controller.rb
301
+ - spec/dummy/app/controllers/welcome_controller.rb
302
+ - spec/dummy/app/controllers/posts_controller.rb
325
303
  - spec/dummy/app/views/posts/filtered.html.haml
326
304
  - spec/dummy/app/views/posts/index.html.haml
305
+ - spec/dummy/app/views/listings/_date.html.haml
327
306
  - spec/dummy/app/views/shared/_post_partial.html.haml
328
307
  - spec/dummy/app/views/welcome/array.html.haml
329
- - spec/dummy/app/views/welcome/hash.html.haml
330
308
  - spec/dummy/app/views/welcome/index.html.haml
309
+ - spec/dummy/app/views/welcome/hash.html.haml
331
310
  - spec/dummy/app/views/welcome/tracks.html.haml
332
- - spec/dummy/config/application.rb
333
- - spec/dummy/config/boot.rb
334
- - spec/dummy/config/database.yml
335
- - spec/dummy/config/environment.rb
336
- - spec/dummy/config/environments/development.rb
311
+ - spec/dummy/app/views/layouts/application.html.erb
312
+ - spec/dummy/app/assets/javascripts/application.js
313
+ - spec/dummy/app/assets/stylesheets/application.css
314
+ - spec/dummy/app/helpers/posts_helper.rb
315
+ - spec/dummy/app/helpers/application_helper.rb
316
+ - spec/dummy/config/routes.rb
317
+ - spec/dummy/config/locales/en.yml
337
318
  - spec/dummy/config/environments/production.rb
319
+ - spec/dummy/config/environments/development.rb
338
320
  - spec/dummy/config/environments/test.rb
321
+ - spec/dummy/config/environment.rb
322
+ - spec/dummy/config/application.rb
323
+ - spec/dummy/config/database.yml
324
+ - spec/dummy/config/boot.rb
339
325
  - spec/dummy/config/initializers/backtrace_silencers.rb
340
- - spec/dummy/config/initializers/inflections.rb
341
- - spec/dummy/config/initializers/listings.rb
342
326
  - spec/dummy/config/initializers/mime_types.rb
343
- - spec/dummy/config/initializers/secret_token.rb
344
327
  - spec/dummy/config/initializers/session_store.rb
345
328
  - spec/dummy/config/initializers/wrap_parameters.rb
346
- - spec/dummy/config/locales/en.yml
347
- - spec/dummy/config/routes.rb
329
+ - spec/dummy/config/initializers/listings.rb
330
+ - spec/dummy/config/initializers/secret_token.rb
331
+ - spec/dummy/config/initializers/inflections.rb
348
332
  - spec/dummy/config.ru
349
- - spec/dummy/db/migrate/20130618143317_create_posts.rb
350
- - spec/dummy/db/migrate/20130618195559_add_author_to_posts.rb
351
- - spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
352
- - spec/dummy/db/migrate/20150611185824_create_albums.rb
353
- - spec/dummy/db/migrate/20150611185922_create_tracks.rb
354
- - spec/dummy/db/schema.rb
355
- - spec/dummy/db/seeds.rb
356
- - spec/dummy/public/404.html
333
+ - spec/dummy/spec
334
+ - spec/dummy/script/rails
335
+ - spec/dummy/Rakefile
336
+ - spec/dummy/public/favicon.ico
357
337
  - spec/dummy/public/422.html
358
338
  - spec/dummy/public/500.html
359
- - spec/dummy/public/favicon.ico
360
- - spec/dummy/Rakefile
339
+ - spec/dummy/public/404.html
340
+ - spec/dummy/db/schema.rb
341
+ - spec/dummy/db/seeds.rb
342
+ - spec/dummy/db/migrate/20150611185922_create_tracks.rb
343
+ - spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
344
+ - spec/dummy/db/migrate/20150611185824_create_albums.rb
345
+ - spec/dummy/db/migrate/20130618143317_create_posts.rb
346
+ - spec/dummy/db/migrate/20130618195559_add_author_to_posts.rb
361
347
  - spec/dummy/README.rdoc
362
- - spec/dummy/script/rails
348
+ - spec/listings/tracks_listing_spec.rb
349
+ - spec/listings/tracks_fixed_order_listing_spec.rb
350
+ - spec/listings/posts_listing_spec.rb
351
+ - spec/models/track_spec.rb
352
+ - spec/models/post_spec.rb
353
+ - spec/models/album_spec.rb
354
+ - spec/support/query_counter.rb
363
355
  - spec/factories/albums.rb
364
- - spec/factories/post.rb
365
- - spec/factories/tracks.rb
366
356
  - spec/factories/traits.rb
357
+ - spec/factories/tracks.rb
358
+ - spec/factories/post.rb
367
359
  - spec/lib/filter_parser_spec.rb
368
360
  - spec/lib/sources/active_record_data_source_spec.rb
369
361
  - spec/lib/sources/object_data_source_spec.rb
370
- - spec/listings/posts_listing_spec.rb
371
- - spec/listings/tracks_fixed_order_listing_spec.rb
372
- - spec/listings/tracks_listing_spec.rb
373
- - spec/models/album_spec.rb
374
- - spec/models/post_spec.rb
375
- - spec/models/track_spec.rb
376
- - spec/spec_helper.rb
377
- - spec/support/query_counter.rb