csv_rb 0.5.2 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54fdb2ba3c988ea18ef59aa17b3302981cda0716289165e9b64427f2a9bcc0e7
4
- data.tar.gz: 160dad5d4976eea5f3d4d09a099ee7cc8ec8a4a299b7e2f914544e980383ab45
3
+ metadata.gz: cb02cd37787e9e0ea952399331109f328530a688c41ed2c2e1300ad419b28583
4
+ data.tar.gz: '09ad0cd11ce165a5f6e5b701385b4a1d8866a6738137de0df11f183f3501de7f'
5
5
  SHA512:
6
- metadata.gz: 8e68ea49b2d0b0b2db5a48fc15f934182608929e5625d4643ce291bb21a20bc97e697a91116d53ee2b80e514cad1115566e5a638e8ce708f75e6a9a172cf8b0e
7
- data.tar.gz: 75685dacbf121d7ec2d96cb5833a348ddc830930bf6eb332ab2a321a88e917a783946325f0adf525f7292fabf3b56f621cdc7519666e54bad4b343dca68b2795
6
+ metadata.gz: 8544b4f13137d0c631792f8f904a6d2892962025411ed7d54ea2041015777bd77b41b431dc700d51ff8f0ac29313ad845287e6e1ad296c5e639ccc612e6b4378
7
+ data.tar.gz: 5fcbb1e4a37041b974bcfb7e37d3d81bc308ae7b2d5023400a881f043a52e0b97526ebc283b25fda293382245aff9a5a3c5f6743fbd3c00b49cfe5f0907953f4
data/README.md CHANGED
@@ -1,16 +1,11 @@
1
- csvrb-Rails — Spreadsheet templates for Rails
1
+ CSVRb-Rails — Streaming CSVs with rbuy templates
2
2
  ===================================================
3
3
 
4
- [![Build Status](https://secure.travis-ci.org/straydogstudio/csv_rb.svg?branch=master)](http://travis-ci.org/straydogstudio/csv_rb)
5
4
  [![Gem
6
5
  Version](https://badge.fury.io/rb/csv_rb.svg)](http://badge.fury.io/rb/csv_rb)
7
- [![Dependency Status](https://gemnasium.com/straydogstudio/csv_rb.svg?branch=master)](https://gemnasium.com/straydogstudio/csv_rb)
8
6
  [![Coverage
9
- Status](https://coveralls.io/repos/straydogstudio/csv_rb/badge.svg)](https://coveralls.io/r/straydogstudio/csv_rb)
10
7
 
11
8
  ![Total downloads](http://ruby-gem-downloads-badge.herokuapp.com/csv_rb?type=total)
12
- ![Downloads for 0.4.0](http://ruby-gem-downloads-badge.herokuapp.com/csv_rb/0.4.0?label=0.4.0)
13
- ![Downloads for 0.5.0](http://ruby-gem-downloads-badge.herokuapp.com/csv_rb/0.5.0?label=0.5.0)
14
9
  ![Downloads for latest release](http://ruby-gem-downloads-badge.herokuapp.com/csv_rb/0.5.1?label=0.5.1)
15
10
 
16
11
  ## Installation
@@ -18,48 +13,21 @@ Status](https://coveralls.io/repos/straydogstudio/csv_rb/badge.svg)](https://cov
18
13
  In your Gemfile:
19
14
 
20
15
  ```ruby
21
- gem 'rubyzip', '>= 1.2.1'
22
- gem 'csvrb', git: 'https://github.com/randym/csvrb.git', ref: 'c8ac844'
23
- gem 'csv_rb'
24
- ```
25
-
26
- **NOTE:** csvrb has been pending release for a long time. You must specify the master on github to support Rubyzip 1.2.1.
27
-
28
- If `rubyzip 1.0.0` is needed:
29
-
30
- ```ruby
31
- gem 'rubyzip', '= 1.0.0'
32
- gem 'csvrb', '= 2.0.1'
33
- gem 'csv_rb'
34
- ```
35
-
36
- If `rubyzip >= 1.1.0` is needed:
37
-
38
- ```ruby
39
- gem 'rubyzip', '~> 1.1.0'
40
- gem 'csvrb', '2.1.0.pre'
16
+ gem 'csv'
41
17
  gem 'csv_rb'
42
18
  ```
43
19
 
44
20
  ## Requirements
45
21
 
46
- * Rails 4.2, 5.0 or 5.1 (tested)
47
- * For Rails 3.1 or 3.2 use version 3.0
48
- * **As of 0.5.0 requires csvrb 2.0.1, but strongly suggests 2.1.0.pre, which requires rubyzip 1.1.0**
49
- * As of Rails 4.1 you must use `render_to_string` to render a mail attachment.
50
-
51
- ## FYI
52
-
53
- * This gem depends on [csvrb](https://github.com/randym/csvrb). See [the blog](http://csvrb.blog.randym.net/) or the [examples page](https://github.com/randym/csvrb/blob/master/examples/example.rb) for usage.
54
- * Check out [csvrb_styler](https://github.com/sakovias/csvrb_styler) by [sakovias](https://github.com/sakovias) for easier styles and borders!
22
+ * Rails 5.2 (tested)
55
23
 
56
24
  ## Usage
57
25
 
58
- csvrb-Rails provides a renderer and a template handler. It adds the `:csv` format and parses `.csv.csvrb` templates. This lets you take all the [csvrb](https://github.com/randym/csvrb) code out of your controller or model and place it inside the template, where view code belongs! **See [this blog post](http://csvrb.blog.randym.net/2012/08/excel-on-rails-like-pro-with-CSVRb.html) for a more complete walkthrough.**
26
+ CSVRb provides a renderer and a template handler. It adds the `:csv` format and parses `.csv.csvrb` templates. This lets you take all the [csvrb](https://github.com/SampsonCrowley/csvrb) code out of your controller or model and place it inside the template, where view code belongs! Strongly inspired by Axlsx-Rails
59
27
 
60
28
  ### Controller
61
29
 
62
- To use csvrb-Rails set your instance variables in your controller and configure the response if needed:
30
+ To use CSVRb set your instance variables in your controller and configure the response if needed:
63
31
 
64
32
  ```ruby
65
33
  class ButtonController < ApplicationController
@@ -77,15 +45,10 @@ end
77
45
  Create the template with the `.csv.csvrb` extension (`action_name.csv.csvrb` for example.) [**Watch out for typos!**](#troubleshooting) In the template, use csv_package variable to create your spreadsheet:
78
46
 
79
47
  ```ruby
80
- wb = csv_package.workbook
81
- wb.add_worksheet(name: "Buttons") do |sheet|
82
- @buttons.each do |button|
83
- sheet.add_row [button.name, button.category, button.price]
84
- end
85
- end
48
+ csv << ['Cell 1', 'Cell 2']
86
49
  ```
87
50
 
88
- This is where you place all your [csvrb](https://github.com/randym/csvrb) specific markup. Add worksheets, fill content, merge cells, add styles. See the [csvrb examples](https://github.com/randym/csvrb/tree/master/examples/example.rb) page to see what you can do.
51
+ This is where you place all your [csvrb](https://github.com/SampsonCrowley/csvrb) specific markup. Add worksheets, fill content, merge cells, add styles. See the [csvrb examples](https://github.com/SampsonCrowley/csvrb/tree/master/examples/example.rb) page to see what you can do.
89
52
 
90
53
  Remember, like in `erb` templates, view helpers are available to use the `.csv.csvrb` template.
91
54
 
@@ -141,48 +104,20 @@ If that fails, pass the `:filename` parameter:
141
104
  render csv: "action_or_template", filename: "my_new_filename.csv"
142
105
  ```
143
106
 
144
- ### csv_rb Package Options
145
-
146
- csv_rb provides three options for initializing a spreadsheet:
147
-
148
- - **:csv_author** (String) - The author of the document
149
- - **:csv_created_at** (Time) - Timestamp in the document properties (defaults to current time)
150
- - **:csv_use_shared_strings** (Boolean) - This is passed to the workbook to specify that shared strings should be used when serializing the package.
151
-
152
- To pass these to the new package, pass them to `render :csv` _or_ pass them as local variables.
153
-
154
- For example, to set the author name, pass the `:csv_author` parameter to `render :csv` _or_ as a local variable:
155
-
156
- ```ruby
157
- render csv: "index", csv_author: "Elmer Fudd"
158
- render "index", locals: {csv_author: "Elmer Fudd"}
159
- ```
160
-
161
- Other examples:
162
-
163
- ```ruby
164
- render csv: "index", csv_created_at: 3.days.ago
165
- render "index", locals: {csv_use_shared_strings: true}
166
- ```
167
-
168
107
  ### Partials
169
108
 
170
109
  Partials work as expected, but you must pass in relevant spreadsheet variables:
171
110
 
172
111
  ```ruby
173
- wb = csv_package.workbook
174
- render :partial => 'cover_sheet', :locals => {:wb => wb}
175
- wb.add_worksheet(name: "Content") do |sheet|
176
- sheet.add_row ['Content']
177
- end
112
+ csv << ['BEFORE']
113
+ render :partial => 'looper_partial', :locals => { csv: csv }
114
+ csv << ['AFTER']
178
115
  ```
179
116
 
180
117
  With the partial simply using the passed variables:
181
118
 
182
119
  ```ruby
183
- wb.add_worksheet(name: "Cover Sheet") do |sheet|
184
- sheet.add_row ['Cover', 'Sheet']
185
- end
120
+ csv << ['Partial Content']
186
121
  ```
187
122
 
188
123
  ### Mailers
@@ -207,304 +142,22 @@ end
207
142
  * If the template (`users/export`) can refer to only one file (the csv.csvrb template), you do not need to specify `handlers`, provided the `formats` includes `:csv`.
208
143
  * Specifying the encoding as 'base64' can avoid UTF-8 errors.
209
144
 
210
- ### Scripts
211
-
212
- To generate a template within a script, you need to instantiate an ActionView context. Here are two gists showing how to perform this:
213
-
214
- * [Using rails runner](https://gist.github.com/straydogstudio/323139591f2cc5d48fbc)
215
- * [Without rails runner](https://gist.github.com/straydogstudio/dceb775ead81470cea70)
216
-
217
145
  ### Testing
218
146
 
219
- There is no built-in way to test your resulting workbooks / templates. But here is a piece of code that may help you to find a way.
220
-
221
- #### First, create a shared context
222
-
223
- ```ruby
224
- RSpec.shared_context 'csvrb' do
225
-
226
- # all csv specs describe must be normalized
227
- # "folder/view_name.csv.csvrb"
228
- # allow to infer the template path
229
- template_name = description
230
-
231
- let(:template_path) do
232
- ['app', 'views', template_name]
233
- end
234
-
235
- # This helper will be used in tests
236
- def render_template(locals = {})
237
- csvrb_binding = Kernel.binding
238
- locals.each do |key, value|
239
- csvrb_binding.local_variable_set key, value
240
- end
241
- # define a default workbook and a default sheet useful when testing partial in isolation
242
- wb = CSVRb::Package.new.workbook
243
- csvrb_binding.local_variable_set(:wb, wb)
244
- csvrb_binding.local_variable_set(:sheet, wb.add_worksheet)
245
-
246
- # mimics an ActionView::Template class, presenting a 'source' method
247
- # to retrieve the content of the template
248
- csvrb_binding.eval(ActionView::Template::Handlers::CSVRbBuilder.call(Struct.new(:source).new(File.read(Rails.root.join(*template_path)))))
249
- csvrb_binding.local_variable_get(:wb)
250
- end
251
- end
252
- ```
253
-
254
- #### Include it in your spec files:
255
-
256
- ```ruby
257
- require 'spec_helper'
258
- require 'helpers/csvrb_context'
259
-
260
- describe 'shared/_total_request.csv.csvrb' do
261
- include_context 'csvrb'
262
-
263
- before :each do
264
- # all the instance variables here are the one used in 'shared/_total_request.csv.csvrb'
265
- @widget = mock_model(Widget, name: 'My widget')
266
- @message_counts = Struct.new(:count_all, :positives, :negatives, :neutrals).new(42, 23, 15, 25)
267
- end
268
-
269
- it 'has a title line mentioning the widget' do
270
- wb = render_template
271
- sheet = wb.sheet_by_name('Réf. Requête')
272
- expect(sheet).to have_header_cells ['My widget : Messages de la requête']
273
- end
274
-
275
- it 'exports the message counts' do
276
- wb = render_template
277
- sheet = wb.sheet_by_name('Réf. Requête')
278
- expect(sheet).to have_cells(['Toutes tonalités', 'Tonalité positive', 'Tonalité négative', 'Tonalité neutre']).in_row(2)
279
- expect(sheet).to have_cells([42, 23, 15, 25]).in_row(3)
280
- end
281
-
282
- end
283
- ```
284
-
285
- #### Matchers used
286
-
287
- ```ruby
288
-
289
- # encoding: UTF-8
290
-
291
- require 'rspec/expectations'
292
-
293
- module XslsMatchers
294
-
295
- RSpec::Matchers.define :have_header_cells do |cell_values|
296
- match do |worksheet|
297
- worksheet.rows[0].cells.map(&:value) == cell_values
298
- end
299
-
300
- failure_message do |actual|
301
- "Expected #{actual.rows[0].cells.map(&:value)} to be #{expected}"
302
- end
303
- end
304
-
305
- RSpec::Matchers.define :have_cells do |expected|
306
- match do |worksheet|
307
- worksheet.rows[@index].cells.map(&:value) == expected
308
- end
309
-
310
- chain :in_row do |index|
311
- @index = index
312
- end
313
-
314
- failure_message do |actual|
315
- "Expected #{actual.rows[@index].cells.map(&:value)} to include #{expected} at row #{@index}."
316
- end
317
- end
318
- end
319
-
320
- ```
321
-
322
-
323
- ## Troubleshooting
324
-
325
- ### Mispellings
326
-
327
- **It is easy to get the spelling wrong in the extension name, the format.csv statement, or in a render call.** Here are some possibilities:
328
-
329
- * If it says your template is missing, check that its extension is `.csv.csvrb`.
330
- * If you get the error `uninitialized constant Mime::XSLX` you have used `format.xslx` instead of `format.csv`, or something similar.
331
-
332
- ### Mailer Attachments: No content, cannot read, Invalid Byte Sequence in UTF-8
333
-
334
- If you are having problems with rendering a template and attaching it to a template, try a few options:
335
-
336
- * Make sure the attachment template does not have the same name as the mailer.
337
- * After you have rendered the template to string, and before you call the mailer, execute `self.instance_variable_set(:@_lookup_context, nil)`. If you must do this, please open an issue.
338
- * If you get Invalid Byte Sequence in UTF-8, pass `encoding: 'base64'` with the attachment:
339
-
340
- ```ruby
341
- class UserMailer < ActionMailer::Base
342
- def export(users)
343
- csv = render_to_string handlers: [:csvrb], formats: [:csv], template: "users/export", locals: {users: users}
344
- attachments["Users.csv"] = {mime_type: Mime[:csv], content: csv, encoding: 'base64'}
345
- # For Rails 4 use Mime::csv
346
- # attachments["Users.csv"] = {mime_type: Mime::csv, content: csv, encoding: 'base64'}
347
- # self.instance_variable_set(:@_lookup_context, nil) # If attachments are rendered as content, try this and open an issue
348
- ...
349
- end
350
- end
351
- ```
352
-
353
- If you get these errors, please open an issue and share code so the bug can be isolated. Or comment on issue [#29](https://github.com/straydogstudio/csv_rb/issues/29) or [#25](https://github.com/straydogstudio/csv_rb/issues/25).
354
-
355
- ### Generated Files Can't Be Opened or Invalid Byte Sequence in UTF-8
356
-
357
- Both these errors *appear* to be caused by Rails applying a layout to the template. Passing `layout: false` to `render :csv` should fix this issue. Version 0.5.0 attempts to fix this issue.
358
-
359
- If you get this error, please open an issue and share code so the bug can be isolated.
360
-
361
- ### Rails 4.2 changes
362
-
363
- Before Rails 4.2 you could call:
364
-
365
- ```ruby
366
- render csv: "users/index"
367
- ```
368
-
369
- And csv_rb could adjust the paths and make sure the template was loaded from the right directory. This is no longer possible because the paths are cached between requests for a given controller. As a result, to display a template in another directory you must use the `:template` parameter (which is normal Rails behavior anyway):
370
-
371
- ```ruby
372
- render csv: "index", template: "users/index"
373
- ```
374
-
375
- If the request format matches you should be able to call:
376
-
377
- ```ruby
378
- render "users/index"
379
- ```
380
-
381
- This is a breaking change if you have the old syntax!
382
-
383
- ### Turbolinks
384
-
385
- If you are using turbolinks, you may need to disable turbolinks when you link to your spreadsheet:
386
-
387
- ```ruby
388
- # turbolinks 5:
389
- link_to 'Download spreadsheet', path_to_sheet, data: {turbolinks: false}
390
- ```
391
-
392
- ### What to do
393
-
394
- If you are having problems, try to isolate the issue. Use the console or a script to make sure your data is good. Then create the spreadsheet line by line without csvrb-Rails to see if you are having csvrb problems. If you can manually create the spreadsheet, create an issue and we will work it out.
395
-
396
- ## Dependencies
397
-
398
- - [Rails](https://github.com/rails/rails)
399
- - [csvrb](https://github.com/randym/csvrb)
147
+ There is no built-in way to test your resulting sheets at this time
400
148
 
401
149
  ## Authors
402
150
 
403
- * [Noel Peden](https://github.com/straydogstudio)
151
+ * [Sampson Crowley](https://github.com/SampsonCrowley)
404
152
 
405
153
  ## Contributors
406
154
 
407
- Many thanks to [contributors](https://github.com/straydogstudio/csv_rb/graphs/contributors):
155
+ Many thanks to [contributors](https://github.com/SampsonCrowley/csv_rb/graphs/contributors):
408
156
 
409
- * [randym](https://github.com/randym)
410
- * [sugi](https://github.com/sugi)
411
- * [envek](https://github.com/envek)
412
- * [engwan](https://github.com/engwan)
413
- * [maxd](https://github.com/maxd)
414
- * [firien](https://github.com/firien)
415
- * [kaluzny](https://github.com/kaluznyo)
416
- * [sly7-7](https://github.com/sly7-7)
417
- * [kodram](https://github.com/kodram)
418
- * [JohnSmall](https://github.com/JohnSmall)
419
- * [BenoitHiller](https://github.com/BenoitHiller)
420
-
421
- ## Donations
422
-
423
- Say thanks for csvrb-Rails by donating! It makes it easier for me to provide to open
424
- source:
425
-
426
- [![Click here to lend your support to: csvrb-Rails!](http://www.pledgie.com/campaigns/27737.png?skin_name=chrome)](http://www.pledgie.com/campaigns/27737)
157
+ * [Noel Peden](https://github.com/straydogstudio) for creating axlsx
427
158
 
428
159
  ## Change log
429
160
 
430
- **May 1st, 2018**: 0.5.2 release
431
-
432
- - Improved Rails 5 compatibility re MIME type
433
-
434
- **March 29th, 2017**: 0.5.1 release
435
-
436
- - Fix stack trace line numbers
437
- - Thanks to [BenoitHiller](https://github.com/BenoitHiller)
438
-
439
- **July 26st, 2016**: 0.5.0 release
440
-
441
- - Support for Rails 5
442
- - **Tested on on Rails 4.0, 4.1, 4.2, and 5.0**
443
- - Bug fixes for unreadable files and UTF-8 errors
444
-
445
- **July 13th, 2015**: 0.4.0 release
446
-
447
- - Support for Rails 4.2
448
- - **Removal of forced default_formats** (url format must match)
449
- - **Tested only on Rails 4.1 and 4.2**
450
- - **For Rails 3.2 or below, use 0.3.0**
451
-
452
- **November 20th, 2014**: 0.3.0 release
453
-
454
- - Support for Rails 4.2.beta4.
455
- - **Removal of shorthand template syntax** (`render csv: 'another/directory'`)
456
-
457
- **September 4, 2014**: 0.2.1 release
458
-
459
- - Rails 4.2.beta1 no longer includes responder. This release checks for the existence of responder before configuring a default responder.
460
- - Rails 4.2 testing, though not yet on Travis CI
461
- - Author, created_at, and use_shared_strings parameters for CSVRb::Package.new
462
-
463
- **April 9, 2014**: 0.2.0 release
464
-
465
- - Require csvrb 2.0.1, which requires rubyzip 1.0.0
466
- - Better render handling and testing, which might break former usage
467
- - Rails 4.1 testing
468
- - Mailer example update (**use render_to_string not render**)
469
-
470
- **October 11, 2013**
471
-
472
- - Handle (and test) respond_to override
473
-
474
- **October 4, 2013**
475
-
476
- - Added coveralls
477
- - Raised testing to csvrb 2.0.1, roo 1.12.2, and rubyzip 1.0.0
478
-
479
- **July 25, 2013**
480
-
481
- - Documentation improved
482
- - Testing for generating partial in mailer
483
-
484
- **January 18, 2013**: 0.1.4 release
485
-
486
- - Now supports Rails 4 (thanks [Envek](https://github.com/Envek))
487
- - If you call render :csv on a request without :csv format, it should force the :csv format. Works on Rails 3.2+.
488
-
489
- **December 6, 2012**: 0.1.3 release
490
-
491
- - Fix for absolute template paths
492
-
493
- **July 25, 2012**: 0.1.2 release
494
-
495
- - Partials tested
496
-
497
- **July 19, 2012**: 0.1.1 release
498
-
499
- - Travis-ci added (thanks [randym](https://github.com/randym))
500
- - render statements and filename tests fixes (thanks [engwan](https://github.com/engwan))
501
-
502
- **July 17, 2012**: 0.1.0 release
503
-
504
- - Tests completed
505
- - Acts_as_csv tested, example in docs
506
-
507
- **July 12, 2012**: 0.0.1 release
161
+ **June 6th, 2019**: 0.5.2 release
508
162
 
509
- - Initial posting.
510
- - It works, but there are no tests! Bad programmer!
163
+ - Initial Release
@@ -28,8 +28,10 @@ ActionController::Renderers.add :csv do |filename, options|
28
28
  options[:locals] ||= {}
29
29
  file_name = "#{options.delete(:filename) || filename.gsub(/^.*\//,'')}#{options.delete(:with_time) ? "-#{Time.zone.now.to_s}" : ''}.csv".sub(/(\.csv)+$/, '.csv')
30
30
 
31
-
32
- # if options.delete(:should_stream)
31
+ response.headers["Content-Type"] = "text/csv; charset=utf-8"
32
+
33
+ unless options.delete(:allow_cache)
34
+ expires_now
33
35
  response.headers["X-Accel-Buffering"] = 'no'
34
36
  response.headers["Content-Type"] = "text/csv; charset=utf-8"
35
37
  response.headers["Content-Encoding"] = 'deflate'
@@ -41,11 +43,11 @@ ActionController::Renderers.add :csv do |filename, options|
41
43
  instance_eval lookup_context.find_template(options[:template], options[:prefixes], options[:partial], options.dup.merge(formats: [:csv])).source
42
44
  csv.close
43
45
  end
44
- # else
45
- # disposition = options.delete(:disposition) || 'attachment'
46
- #
47
- # send_data render_to_string(options), filename: file_name, type: Mime[:csv], disposition: disposition
48
- # end
46
+ else
47
+ disposition = options.delete(:disposition) || 'attachment'
48
+
49
+ send_data render_to_string(options), filename: file_name, type: Mime[:csv], disposition: disposition
50
+ end
49
51
  end
50
52
 
51
53
  # For respond_to default
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CSVRb
4
- VERSION = '0.5.2'
4
+ VERSION = '5.2.1'
5
5
  end
Binary file
@@ -25345,3 +25345,227 @@ Processing by UsersController#show as CSV
25345
25345
  Rendering users/respond_with.csv.csvrb
25346
25346
  Rendered users/respond_with.csv.csvrb (0.2ms)
25347
25347
  Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
25348
+ User Load (0.5ms) SELECT "users".* FROM "users"
25349
+  (0.0ms) begin transaction
25350
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 500]]
25351
+  (4.5ms) commit transaction
25352
+  (0.0ms) begin transaction
25353
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Responder"], ["last_name", "Bunny"], ["address", "1234 Right Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.315787"], ["updated_at", "2019-06-07 00:05:25.315787"]]
25354
+  (1.9ms) commit transaction
25355
+ Started GET "/users/501.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25356
+ Processing by UsersController#show as CSV
25357
+ Parameters: {"id"=>"501"}
25358
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 501], ["LIMIT", 1]]
25359
+ Rendering users/respond_with.csv.csvrb
25360
+ Rendered users/respond_with.csv.csvrb (0.4ms)
25361
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.1ms)
25362
+ Started GET "/another" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25363
+ Processing by HomeController#another as HTML
25364
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
25365
+ Started GET "/withpartial.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25366
+ Processing by HomeController#withpartial as CSV
25367
+ Rendering home/withpartial.csv.csvrb
25368
+ Rendered home/_cover_sheet.csv.csvrb (0.2ms)
25369
+ Rendered home/withpartial.csv.csvrb (0.6ms)
25370
+ Completed 200 OK in 1ms (Views: 1.2ms | ActiveRecord: 0.0ms)
25371
+ User Load (0.1ms) SELECT "users".* FROM "users"
25372
+  (0.0ms) begin transaction
25373
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 501]]
25374
+  (2.0ms) commit transaction
25375
+  (0.1ms) begin transaction
25376
+ User Create (0.6ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Bugs"], ["last_name", "Bunny"], ["address", "1234 Left Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.339798"], ["updated_at", "2019-06-07 00:05:25.339798"]]
25377
+  (2.4ms) commit transaction
25378
+  (0.0ms) begin transaction
25379
+ Like Create (0.1ms) INSERT INTO "likes" ("name", "user_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "Carrots"], ["user_id", 502], ["created_at", "2019-06-07 00:05:25.381543"], ["updated_at", "2019-06-07 00:05:25.381543"]]
25380
+  (1.8ms) commit transaction
25381
+  (0.0ms) begin transaction
25382
+ Like Create (0.1ms) INSERT INTO "likes" ("name", "user_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "Celery"], ["user_id", 502], ["created_at", "2019-06-07 00:05:25.384366"], ["updated_at", "2019-06-07 00:05:25.384366"]]
25383
+  (2.7ms) commit transaction
25384
+ Started GET "/users/502/likes.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25385
+ Processing by LikesController#index as CSV
25386
+ Parameters: {"user_id"=>"502"}
25387
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 502], ["LIMIT", 1]]
25388
+ Rendering likes/index.csv.csvrb
25389
+ Like Load (0.1ms) SELECT "likes".* FROM "likes" WHERE "likes"."user_id" = ? [["user_id", 502]]
25390
+ Rendered likes/index.csv.csvrb (0.9ms)
25391
+ Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.1ms)
25392
+ User Load (0.0ms) SELECT "users".* FROM "users"
25393
+  (0.0ms) begin transaction
25394
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 502]]
25395
+  (1.7ms) commit transaction
25396
+  (0.0ms) begin transaction
25397
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Bugs"], ["last_name", "Bunny"], ["address", "1234 Left Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.394684"], ["updated_at", "2019-06-07 00:05:25.394684"]]
25398
+  (1.8ms) commit transaction
25399
+ Started GET "/users/503/render_elsewhere.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25400
+ Processing by LikesController#render_elsewhere as CSV
25401
+ Parameters: {"user_id"=>"503"}
25402
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 503], ["LIMIT", 1]]
25403
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
25404
+ User Load (0.0ms) SELECT "users".* FROM "users"
25405
+ Started GET "/home/render_elsewhere.csv?type=5" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25406
+ Processing by HomeController#render_elsewhere as CSV
25407
+ Parameters: {"type"=>"5"}
25408
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
25409
+ Started GET "/home/render_elsewhere.csv?type=4" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25410
+ Processing by HomeController#render_elsewhere as CSV
25411
+ Parameters: {"type"=>"4"}
25412
+ Rendering users/index.csv.csvrb
25413
+ User Load (0.0ms) SELECT "users".* FROM "users"
25414
+ Rendered users/index.csv.csvrb (0.4ms)
25415
+ Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
25416
+ Started GET "/home/render_elsewhere.csv?type=3" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25417
+ Processing by HomeController#render_elsewhere as CSV
25418
+ Parameters: {"type"=>"3"}
25419
+ Rendering users/index.csv.csvrb
25420
+ User Load (0.0ms) SELECT "users".* FROM "users"
25421
+ Rendered users/index.csv.csvrb (0.3ms)
25422
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
25423
+ Started GET "/home/render_elsewhere.csv?type=1" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25424
+ Processing by HomeController#render_elsewhere as CSV
25425
+ Parameters: {"type"=>"1"}
25426
+ Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
25427
+ User Load (0.0ms) SELECT "users".* FROM "users"
25428
+ Started GET "/another.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25429
+ Processing by HomeController#another as CSV
25430
+ Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
25431
+ Started GET "/useheader.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25432
+ Processing by HomeController#useheader as CSV
25433
+ Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
25434
+  (0.0ms) begin transaction
25435
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Elmer"], ["last_name", "Fudd"], ["address", "1234 Somewhere, Over NY 11111"], ["email", "elmer@fudd.com"], ["created_at", "2019-06-07 00:05:25.406757"], ["updated_at", "2019-06-07 00:05:25.406757"]]
25436
+  (2.1ms) commit transaction
25437
+ Started GET "/" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25438
+ Processing by HomeController#index as HTML
25439
+ Rendering home/index.html.erb within layouts/application
25440
+ Rendered home/index.html.erb within layouts/application (0.5ms)
25441
+ Completed 200 OK in 1ms (Views: 1.0ms | ActiveRecord: 0.0ms)
25442
+ User Load (0.0ms) SELECT "users".* FROM "users"
25443
+  (0.0ms) begin transaction
25444
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 503]]
25445
+  (2.0ms) commit transaction
25446
+  (0.0ms) begin transaction
25447
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 504]]
25448
+  (1.6ms) commit transaction
25449
+  (0.0ms) begin transaction
25450
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Elmer"], ["last_name", "Fudd"], ["address", "1234 Somewhere, Over NY 11111"], ["email", "elmer@fudd.com"], ["created_at", "2019-06-07 00:05:25.416922"], ["updated_at", "2019-06-07 00:05:25.416922"]]
25451
+  (1.6ms) commit transaction
25452
+  (0.0ms) begin transaction
25453
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Bugs"], ["last_name", "Bunny"], ["address", "1234 Left Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.419183"], ["updated_at", "2019-06-07 00:05:25.419183"]]
25454
+  (1.5ms) commit transaction
25455
+ Started GET "/users.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25456
+ Processing by UsersController#index as CSV
25457
+ Rendering users/index.csv.csvrb
25458
+ User Load (0.1ms) SELECT "users".* FROM "users"
25459
+ Rendered users/index.csv.csvrb (0.5ms)
25460
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.1ms)
25461
+ Started GET "/useheader.csv?set_direct=true" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25462
+ Processing by HomeController#useheader as CSV
25463
+ Parameters: {"set_direct"=>"true"}
25464
+ Rendering home/useheader.csv.csvrb
25465
+ Rendered home/useheader.csv.csvrb (0.3ms)
25466
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
25467
+ User Load (0.1ms) SELECT "users".* FROM "users"
25468
+  (0.0ms) begin transaction
25469
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 505]]
25470
+  (2.6ms) commit transaction
25471
+  (0.0ms) begin transaction
25472
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 506]]
25473
+  (1.5ms) commit transaction
25474
+  (0.0ms) begin transaction
25475
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Responder"], ["last_name", "Bunny"], ["address", "1234 Right Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.431932"], ["updated_at", "2019-06-07 00:05:25.431932"]]
25476
+  (1.6ms) commit transaction
25477
+ Started GET "/users/export/507.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25478
+ Processing by UsersController#export as CSV
25479
+ Parameters: {"id"=>"507"}
25480
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 507], ["LIMIT", 1]]
25481
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
25482
+ Started GET "/another" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25483
+ Processing by HomeController#another as */*
25484
+ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
25485
+ Started GET "/home/only_html" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25486
+ Processing by HomeController#only_html as */*
25487
+ Rendering home/only_html.html.erb within layouts/application
25488
+ Rendered home/only_html.html.erb within layouts/application (0.1ms)
25489
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
25490
+ User Load (0.1ms) SELECT "users".* FROM "users"
25491
+  (0.0ms) begin transaction
25492
+ User Destroy (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 507]]
25493
+  (1.5ms) commit transaction
25494
+  (0.0ms) begin transaction
25495
+ User Create (0.2ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Elmer"], ["last_name", "Fudd"], ["address", "1234 Somewhere, Over NY 11111"], ["email", "elmer@fudd.com"], ["created_at", "2019-06-07 00:05:25.443773"], ["updated_at", "2019-06-07 00:05:25.443773"]]
25496
+  (1.4ms) commit transaction
25497
+  (0.0ms) begin transaction
25498
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Bugs"], ["last_name", "Bunny"], ["address", "1234 Left Turn, Albuquerque NM 22222"], ["email", "bugs@bunny.com"], ["created_at", "2019-06-07 00:05:25.446227"], ["updated_at", "2019-06-07 00:05:25.446227"]]
25499
+  (1.4ms) commit transaction
25500
+ Started GET "/users/noaction.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25501
+ Processing by UsersController#noaction as CSV
25502
+ Rendering users/noaction.csv.csvrb
25503
+ User Load (0.0ms) SELECT "users".* FROM "users"
25504
+ Rendered users/noaction.csv.csvrb (0.6ms)
25505
+ Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
25506
+ Started GET "/home.csv" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25507
+ Processing by HomeController#index as CSV
25508
+ Rendering home/index.csv.csvrb
25509
+ Rendered home/index.csv.csvrb (0.2ms)
25510
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
25511
+  (0.0ms) begin transaction
25512
+ User Create (0.1ms) INSERT INTO "users" ("name", "last_name", "address", "email", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["name", "Elmer"], ["last_name", "Fudd"], ["address", "1234 Somewhere, Over NY 11111"], ["email", "elmer@fudd.com"], ["created_at", "2019-06-07 00:05:25.454191"], ["updated_at", "2019-06-07 00:05:25.454191"]]
25513
+  (1.6ms) commit transaction
25514
+ Started GET "/users/510/send_instructions" for 127.0.0.1 at 2019-06-06 18:05:25 -0600
25515
+ Processing by UsersController#send_instructions as HTML
25516
+ Parameters: {"user_id"=>"510"}
25517
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 510], ["LIMIT", 1]]
25518
+ Rendering users/send_instructions.csv.csvrb
25519
+ Rendered users/send_instructions.csv.csvrb (0.2ms)
25520
+ Rendering notifier/instructions.html.erb
25521
+ Rendered notifier/instructions.html.erb (0.2ms)
25522
+ Notifier#instructions: processed outbound mail in 110.3ms
25523
+ Sent mail to elmer@fudd.com (3.3ms)
25524
+ Date: Thu, 06 Jun 2019 18:05:25 -0600
25525
+ From: noreply@company.com
25526
+ To: elmer@fudd.com
25527
+ Message-ID: <5cf9aa458cd89_359f2ab7bbdfd96c83899@archlinux.mail>
25528
+ Subject: Instructions
25529
+ Mime-Version: 1.0
25530
+ Content-Type: multipart/mixed;
25531
+ boundary="--==_mimepart_5cf9aa458c56f_359f2ab7bbdfd96c8372f";
25532
+ charset=UTF-8
25533
+ Content-Transfer-Encoding: 7bit
25534
+
25535
+
25536
+ ----==_mimepart_5cf9aa458c56f_359f2ab7bbdfd96c8372f
25537
+ Content-Type: text/html;
25538
+ charset=UTF-8
25539
+ Content-Transfer-Encoding: 7bit
25540
+
25541
+ <!DOCTYPE html>
25542
+ <html>
25543
+ <head>
25544
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
25545
+ </head>
25546
+ <body>
25547
+ <h1>Instructions</h1>
25548
+ <p>
25549
+ You have successfully signed up to example.com,
25550
+ your username is: elmer@fudd.com.<br/>
25551
+ </p>
25552
+ <p>Thanks for joining and have a great day!</p>
25553
+ </body>
25554
+ </html>
25555
+
25556
+ ----==_mimepart_5cf9aa458c56f_359f2ab7bbdfd96c8372f
25557
+ Content-Type: text/csv;
25558
+ charset=UTF-8
25559
+ Content-Transfer-Encoding: base64
25560
+ Content-Disposition: attachment;
25561
+ filename=user_510.csv
25562
+ Content-ID: <5cf9aa458d1a8_359f2ab7bbdfd96c839dc@archlinux.mail>
25563
+
25564
+ IjUxMCIsIkVsbWVyIiwiZWxtZXJAZnVkZC5jb20iDQoiIiwiSW5zdHJ1Y3Rp
25565
+ b25zIiwiIg0K
25566
+
25567
+ ----==_mimepart_5cf9aa458c56f_359f2ab7bbdfd96c8372f--
25568
+
25569
+ Rendering text template
25570
+ Rendered text template (0.0ms)
25571
+ Completed 200 OK in 122ms (Views: 0.3ms | ActiveRecord: 0.1ms)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-06 00:00:00.000000000 Z
11
+ date: 2019-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack