listings 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/controllers/listings/listings_controller.rb +1 -1
- data/lib/listings/base.rb +19 -20
- data/lib/listings/version.rb +1 -1
- data/spec/dummy/spec +1 -1
- metadata +54 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4591a7706b0590ae7a1958eb970989b111ddd602
|
4
|
+
data.tar.gz: 9d77ce4ae69577c507ebce9ad93eaf1383dbb794
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0da43eddc770ae15ad49502830922bc4f5592be2135fe888c4a24549ca66a592deef3c8982bfb1ff0db6c7f4bbec4d9c601d70d3218e610717e3806f6bfb812
|
7
|
+
data.tar.gz: a2f408023fbe5f2a6fca0615ebeeeedd75be2e129c40bb2ecaa02318af7465a50c025bfc09f2c6d3caf6afcf6e6d532401197f8603bf2073babd59d8fecb186c
|
@@ -20,7 +20,7 @@ module Listings
|
|
20
20
|
@listing = prepare_listing params, view_context, false
|
21
21
|
|
22
22
|
respond_to do |format|
|
23
|
-
format.csv {
|
23
|
+
format.csv { @listing.send_csv(self) }
|
24
24
|
format.xls do
|
25
25
|
headers["Content-Disposition"] = "attachment; filename=\"#{@listing.export_filename(:xls)}\""
|
26
26
|
render 'listings/export'
|
data/lib/listings/base.rb
CHANGED
@@ -177,26 +177,25 @@ module Listings
|
|
177
177
|
(params[:format] || :html).to_sym
|
178
178
|
end
|
179
179
|
|
180
|
-
def
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
csv << row
|
180
|
+
def send_csv(controller)
|
181
|
+
csv_filename = self.export_filename(:csv)
|
182
|
+
|
183
|
+
controller.headers["X-Accel-Buffering"] = "no"
|
184
|
+
controller.headers["Cache-Control"] = "no-cache"
|
185
|
+
controller.headers["Content-Type"] = "text/csv; charset=utf-8"
|
186
|
+
controller.headers["Content-Disposition"] = %(attachment; filename="#{csv_filename}")
|
187
|
+
controller.headers["Transfer-Encoding"] = "chunked"
|
188
|
+
controller.headers.delete("Content-Length")
|
189
|
+
|
190
|
+
controller.response_body = Enumerator.new do |lines|
|
191
|
+
lines << self.columns.map { |c| c.human_name }.to_csv
|
192
|
+
|
193
|
+
self.items.find_each do |item|
|
194
|
+
row = []
|
195
|
+
self.columns.each do |col|
|
196
|
+
row << col.value_for(item)
|
197
|
+
end
|
198
|
+
lines << row.to_csv
|
200
199
|
end
|
201
200
|
end
|
202
201
|
end
|
data/lib/listings/version.rb
CHANGED
data/spec/dummy/spec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
spec/dummy/../../spec
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian J. Cardiff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -285,88 +285,89 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
287
|
requirements: []
|
288
|
-
|
288
|
+
rubyforge_project:
|
289
|
+
rubygems_version: 2.6.12
|
289
290
|
signing_key:
|
290
291
|
specification_version: 4
|
291
292
|
summary: Simple creation of listings in rails applications.
|
292
293
|
test_files:
|
293
|
-
- spec/
|
294
|
-
- spec/dummy/
|
295
|
-
- spec/dummy/app/
|
294
|
+
- spec/dummy/README.rdoc
|
295
|
+
- spec/dummy/Rakefile
|
296
|
+
- spec/dummy/app/assets/config/manifest.js
|
297
|
+
- spec/dummy/app/assets/javascripts/application.js
|
298
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
299
|
+
- spec/dummy/app/controllers/application_controller.rb
|
300
|
+
- spec/dummy/app/controllers/posts_controller.rb
|
301
|
+
- spec/dummy/app/controllers/welcome_controller.rb
|
302
|
+
- spec/dummy/app/helpers/application_helper.rb
|
303
|
+
- spec/dummy/app/helpers/posts_helper.rb
|
296
304
|
- spec/dummy/app/listings/array_listing.rb
|
297
305
|
- spec/dummy/app/listings/authors_listing.rb
|
306
|
+
- spec/dummy/app/listings/filtered_posts_listing.rb
|
298
307
|
- spec/dummy/app/listings/hash_listing.rb
|
299
|
-
- spec/dummy/app/listings/
|
308
|
+
- spec/dummy/app/listings/posts_listing.rb
|
300
309
|
- spec/dummy/app/listings/tracks_fixed_order_listing.rb
|
301
|
-
- spec/dummy/app/
|
310
|
+
- spec/dummy/app/listings/tracks_listing.rb
|
302
311
|
- spec/dummy/app/models/album.rb
|
303
312
|
- spec/dummy/app/models/author.rb
|
304
313
|
- spec/dummy/app/models/object_album.rb
|
305
|
-
- spec/dummy/app/models/
|
314
|
+
- spec/dummy/app/models/object_track.rb
|
306
315
|
- spec/dummy/app/models/post.rb
|
307
|
-
- spec/dummy/app/
|
308
|
-
- spec/dummy/app/
|
309
|
-
- spec/dummy/app/controllers/posts_controller.rb
|
310
|
-
- spec/dummy/app/views/posts/filtered.html.haml
|
311
|
-
- spec/dummy/app/views/posts/index.html.haml
|
316
|
+
- spec/dummy/app/models/track.rb
|
317
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
312
318
|
- spec/dummy/app/views/listings/_date.html.haml
|
313
319
|
- spec/dummy/app/views/listings/_posts_count.html.haml
|
320
|
+
- spec/dummy/app/views/posts/filtered.html.haml
|
321
|
+
- spec/dummy/app/views/posts/index.html.haml
|
314
322
|
- spec/dummy/app/views/shared/_post_partial.html.haml
|
315
323
|
- spec/dummy/app/views/welcome/array.html.haml
|
316
|
-
- spec/dummy/app/views/welcome/
|
324
|
+
- spec/dummy/app/views/welcome/authors.html.haml
|
317
325
|
- spec/dummy/app/views/welcome/hash.html.haml
|
326
|
+
- spec/dummy/app/views/welcome/index.html.haml
|
318
327
|
- spec/dummy/app/views/welcome/tracks.html.haml
|
319
|
-
- spec/dummy/app/views/welcome/authors.html.haml
|
320
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
321
|
-
- spec/dummy/app/assets/config/manifest.js
|
322
|
-
- spec/dummy/app/assets/javascripts/application.js
|
323
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
324
|
-
- spec/dummy/app/helpers/posts_helper.rb
|
325
|
-
- spec/dummy/app/helpers/application_helper.rb
|
326
|
-
- spec/dummy/config/routes.rb
|
327
|
-
- spec/dummy/config/locales/en.yml
|
328
|
-
- spec/dummy/config/environments/production.rb
|
329
|
-
- spec/dummy/config/environments/development.rb
|
330
|
-
- spec/dummy/config/environments/test.rb
|
331
|
-
- spec/dummy/config/environment.rb
|
332
328
|
- spec/dummy/config/application.rb
|
333
|
-
- spec/dummy/config/database.yml
|
334
329
|
- spec/dummy/config/boot.rb
|
330
|
+
- spec/dummy/config/database.yml
|
331
|
+
- spec/dummy/config/environment.rb
|
332
|
+
- spec/dummy/config/environments/development.rb
|
333
|
+
- spec/dummy/config/environments/production.rb
|
334
|
+
- spec/dummy/config/environments/test.rb
|
335
335
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
336
|
+
- spec/dummy/config/initializers/inflections.rb
|
337
|
+
- spec/dummy/config/initializers/listings.rb
|
336
338
|
- spec/dummy/config/initializers/mime_types.rb
|
339
|
+
- spec/dummy/config/initializers/secret_token.rb
|
337
340
|
- spec/dummy/config/initializers/session_store.rb
|
338
341
|
- spec/dummy/config/initializers/wrap_parameters.rb
|
339
|
-
- spec/dummy/config/
|
340
|
-
- spec/dummy/config/
|
341
|
-
- spec/dummy/config/initializers/inflections.rb
|
342
|
+
- spec/dummy/config/locales/en.yml
|
343
|
+
- spec/dummy/config/routes.rb
|
342
344
|
- spec/dummy/config.ru
|
343
|
-
- spec/dummy/spec
|
344
|
-
- spec/dummy/script/rails
|
345
|
-
- spec/dummy/Rakefile
|
346
|
-
- spec/dummy/public/favicon.ico
|
347
|
-
- spec/dummy/public/422.html
|
348
|
-
- spec/dummy/public/500.html
|
349
|
-
- spec/dummy/public/404.html
|
350
|
-
- spec/dummy/db/schema.rb
|
351
|
-
- spec/dummy/db/seeds.rb
|
352
|
-
- spec/dummy/db/migrate/20150611185922_create_tracks.rb
|
353
|
-
- spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
|
354
|
-
- spec/dummy/db/migrate/20150611185824_create_albums.rb
|
355
345
|
- spec/dummy/db/migrate/20130618143317_create_posts.rb
|
356
346
|
- spec/dummy/db/migrate/20130618195559_add_author_to_posts.rb
|
357
|
-
- spec/dummy/
|
358
|
-
- spec/
|
359
|
-
- spec/
|
360
|
-
- spec/
|
361
|
-
- spec/
|
362
|
-
- spec/
|
363
|
-
- spec/
|
364
|
-
- spec/
|
347
|
+
- spec/dummy/db/migrate/20140728151246_add_category_to_post.rb
|
348
|
+
- spec/dummy/db/migrate/20150611185824_create_albums.rb
|
349
|
+
- spec/dummy/db/migrate/20150611185922_create_tracks.rb
|
350
|
+
- spec/dummy/db/schema.rb
|
351
|
+
- spec/dummy/db/seeds.rb
|
352
|
+
- spec/dummy/public/404.html
|
353
|
+
- spec/dummy/public/422.html
|
354
|
+
- spec/dummy/public/500.html
|
355
|
+
- spec/dummy/public/favicon.ico
|
356
|
+
- spec/dummy/script/rails
|
357
|
+
- spec/dummy/spec
|
365
358
|
- spec/factories/albums.rb
|
366
|
-
- spec/factories/traits.rb
|
367
359
|
- spec/factories/authors.rb
|
368
360
|
- spec/factories/posts.rb
|
369
361
|
- spec/factories/tracks.rb
|
362
|
+
- spec/factories/traits.rb
|
370
363
|
- spec/lib/filter_parser_spec.rb
|
371
364
|
- spec/lib/sources/active_record_data_source_spec.rb
|
372
365
|
- spec/lib/sources/object_data_source_spec.rb
|
366
|
+
- spec/listings/posts_listing_spec.rb
|
367
|
+
- spec/listings/tracks_fixed_order_listing_spec.rb
|
368
|
+
- spec/listings/tracks_listing_spec.rb
|
369
|
+
- spec/models/album_spec.rb
|
370
|
+
- spec/models/post_spec.rb
|
371
|
+
- spec/models/track_spec.rb
|
372
|
+
- spec/spec_helper.rb
|
373
|
+
- spec/support/query_counter.rb
|