workbook_rails 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 99b581f30cf5d61337cee27f99be081975f2e89c
4
- data.tar.gz: 9e27f7b3ed8d1abde8754b0e3d9a715a45339617
3
+ metadata.gz: 1fd926c3fdeb525629c6923b117185e4a69eb9a8
4
+ data.tar.gz: 0fad69c2f19078c7f0071a6d93eb0ba201c39e47
5
5
  SHA512:
6
- metadata.gz: fd27b88883fa8915abff6bc44a3172e9b47b358a6a78657deb594f7ff6f1879a4abda80b2668b0ce220e6de8f12fff32ffe9758100ba2aee946ed0faddb324e8
7
- data.tar.gz: 4d78bb123cc96b5c482ff9d820e9086cb2ea0caf798313d7868b8b26059eb160d737b2eda73ab489e5b01e811d5c0af0dcabfdcf1647ab32bbfd2dd5b3e80e15
6
+ metadata.gz: 5f4e7a1d55a326776cb12a32734cf9eec6046cfdebe6270fe3ecaceb9622be0dab18023b10112a19f6ee82171f63316b2df6201c88fea23289a95509ed0d154e
7
+ data.tar.gz: 21925dac1cf348a03169609d9d4bcbb7c7697449f314397f82d6a8e5e0562a2961256e82f9dee0a0e5ffd30607eaf781fbb30c2aa92d43d60bc31baee48435ef
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workbook_rails (0.1.0)
4
+ workbook_rails (0.1.1)
5
5
  actionpack (>= 3.2)
6
6
  workbook (>= 0.4.10)
7
7
 
@@ -1,5 +1,5 @@
1
1
  require 'workbook_rails/engine'
2
2
  module WorkbookRails
3
- FORMATS = [:xlsx, :xls]
3
+ FORMATS = [:xlsx, :xls, :csv]
4
4
  end
5
5
 
@@ -5,6 +5,7 @@ module WorkbookRails
5
5
 
6
6
  def self.workbook_to_string(workbook, format)
7
7
  case format
8
+ when :csv then workbook.sheet.table.to_csv
8
9
  when :xlsx then workbook.stream_xlsx
9
10
  when :xls then
10
11
  io = StringIO.new
@@ -1,3 +1,3 @@
1
1
  module WorkbookRails
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -15,6 +15,7 @@ class HomeController < ApplicationController
15
15
  format.html
16
16
  format.xlsx
17
17
  format.xls
18
+ format.csv
18
19
  end
19
20
  end
20
21
 
@@ -0,0 +1,5 @@
1
+ workbook.sheet.name = "Foobar"
2
+ workbook.sheet.table.push ['Bad', 'spellers', 'of', 'the', 'world', '...']
3
+ workbook.sheet.table.push ['Untie!']
4
+ workbook.sheet.table['A2'].rowspan = 2
5
+ workbook.sheet.table['A2'].format = {width: 16, font_weight: 'bold'}
Binary file
@@ -8573,3 +8573,333 @@ Processing by UsersController#show as XLSX
8573
8573
  User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 57]]
8574
8574
  Rendered users/respond_with.xlsx.wb (8.7ms)
8575
8575
  Completed 200 OK in 21ms (Views: 15.3ms | ActiveRecord: 0.2ms)
8576
+ Started GET "/home.xls" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8577
+ Processing by HomeController#index as XLS
8578
+ Rendered home/index.xls.wb (32.7ms)
8579
+ Completed 200 OK in 104ms (Views: 103.9ms | ActiveRecord: 0.0ms)
8580
+ Started GET "/home/generic.xls" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8581
+ Processing by HomeController#generic as XLS
8582
+ Rendered home/generic.wb (8.5ms)
8583
+ Completed 200 OK in 11ms (Views: 10.6ms | ActiveRecord: 0.0ms)
8584
+ Started GET "/useheader.xlsx?set_direct=true" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8585
+ Processing by HomeController#useheader as XLSX
8586
+ Parameters: {"set_direct"=>"true"}
8587
+ Rendered home/useheader.xlsx.wb (55.9ms)
8588
+ Completed 200 OK in 57ms (Views: 57.0ms | ActiveRecord: 0.0ms)
8589
+ Started GET "/another" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8590
+ Processing by HomeController#another as */*
8591
+ Rendered home/index.xlsx.wb (48.1ms)
8592
+ Rendered text template (0.0ms)
8593
+ Sent data filename_test.xlsx (19.7ms)
8594
+ Completed 200 OK in 70ms (Views: 69.5ms | ActiveRecord: 0.0ms)
8595
+ Started GET "/home/only_html" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8596
+ Processing by HomeController#only_html as */*
8597
+ Rendered home/only_html.html.erb within layouts/application (14.3ms)
8598
+ Completed 200 OK in 64ms (Views: 64.0ms | ActiveRecord: 0.0ms)
8599
+ Started GET "/render_file_path.xlsx" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8600
+ Processing by HomeController#render_file_path as XLSX
8601
+ Rendered users/respond_with.xlsx.wb (14.4ms)
8602
+ Rendered text template (0.0ms)
8603
+ Sent data index.xlsx (0.7ms)
8604
+ Completed 200 OK in 19ms (Views: 18.3ms | ActiveRecord: 0.0ms)
8605
+ Started GET "/useheader.xlsx" for 127.0.0.1 at 2016-04-20 09:00:12 +0200
8606
+ Processing by HomeController#useheader as XLSX
8607
+ Rendered home/useheader.xlsx.wb (56.8ms)
8608
+ Rendered text template (0.0ms)
8609
+ Sent data filename_test.xlsx (0.6ms)
8610
+ Completed 200 OK in 59ms (Views: 58.7ms | ActiveRecord: 0.0ms)
8611
+ Started GET "/another" for 127.0.0.1 at 2016-04-20 09:00:13 +0200
8612
+ Processing by HomeController#another as HTML
8613
+ Rendered home/index.xlsx.wb (49.5ms)
8614
+ Rendered text template (0.0ms)
8615
+ Sent data filename_test.xlsx (0.5ms)
8616
+ Completed 200 OK in 51ms (Views: 50.7ms | ActiveRecord: 0.0ms)
8617
+ Started GET "/another.xlsx" for 127.0.0.1 at 2016-04-20 09:00:13 +0200
8618
+ Processing by HomeController#another as XLSX
8619
+ Rendered home/index.xlsx.wb (44.4ms)
8620
+ Rendered text template (0.0ms)
8621
+ Sent data filename_test.xlsx (0.5ms)
8622
+ Completed 200 OK in 46ms (Views: 45.5ms | ActiveRecord: 0.0ms)
8623
+ Started GET "/home/generic.xlsx" for 127.0.0.1 at 2016-04-20 09:00:13 +0200
8624
+ Processing by HomeController#generic as XLSX
8625
+ Rendered home/generic.wb (7.5ms)
8626
+ Completed 200 OK in 9ms (Views: 8.3ms | ActiveRecord: 0.0ms)
8627
+ Started GET "/withpartial.xlsx" for 127.0.0.1 at 2016-04-20 09:00:13 +0200
8628
+ Processing by HomeController#withpartial as XLSX
8629
+ Rendered home/_cover_sheet.xlsx.wb (7.2ms)
8630
+ Rendered home/withpartial.xlsx.wb (139.9ms)
8631
+ Completed 200 OK in 141ms (Views: 140.7ms | ActiveRecord: 0.0ms)
8632
+  (0.1ms) begin transaction
8633
+ SQL (0.3ms) 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", "2016-04-20 07:00:13.408196"], ["updated_at", "2016-04-20 07:00:13.408196"]]
8634
+  (258.5ms) commit transaction
8635
+ Started GET "/" for 127.0.0.1 at 2016-04-20 09:00:13 +0200
8636
+ Processing by HomeController#index as HTML
8637
+ Rendered home/index.html.erb within layouts/application (1.3ms)
8638
+ Completed 200 OK in 33ms (Views: 33.0ms | ActiveRecord: 0.0ms)
8639
+ User Load (0.2ms) SELECT "users".* FROM "users"
8640
+  (0.1ms) begin transaction
8641
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 57]]
8642
+  (126.7ms) commit transaction
8643
+  (0.1ms) begin transaction
8644
+ SQL (0.2ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 58]]
8645
+  (140.2ms) commit transaction
8646
+  (0.1ms) begin transaction
8647
+ SQL (0.2ms) 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", "2016-04-20 07:00:14.028258"], ["updated_at", "2016-04-20 07:00:14.028258"]]
8648
+  (338.4ms) commit transaction
8649
+ Started GET "/users/59/render_elsewhere.xlsx" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8650
+ Processing by LikesController#render_elsewhere as XLSX
8651
+ Parameters: {"user_id"=>"59"}
8652
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 59]]
8653
+ Rendered users/respond_with.xlsx.wb (55.5ms)
8654
+ Rendered text template (0.0ms)
8655
+ Sent data index.xlsx (0.5ms)
8656
+ Completed 200 OK in 122ms (Views: 60.0ms | ActiveRecord: 0.2ms)
8657
+ Started GET "/home/render_elsewhere.xlsx?type=5" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8658
+ Processing by HomeController#render_elsewhere as XLSX
8659
+ Parameters: {"type"=>"5"}
8660
+ Rendered home/index.xlsx.wb (53.0ms)
8661
+ Rendered text template (0.0ms)
8662
+ Sent data index.xlsx (0.5ms)
8663
+ Completed 200 OK in 54ms (Views: 54.2ms | ActiveRecord: 0.0ms)
8664
+ Started GET "/home/render_elsewhere.xlsx?type=4" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8665
+ Processing by HomeController#render_elsewhere as XLSX
8666
+ Parameters: {"type"=>"4"}
8667
+ Rendered users/respond_with.xlsx.wb (50.8ms)
8668
+ Completed 200 OK in 52ms (Views: 51.3ms | ActiveRecord: 0.0ms)
8669
+ Started GET "/home/render_elsewhere.xlsx?type=3" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8670
+ Processing by HomeController#render_elsewhere as XLSX
8671
+ Parameters: {"type"=>"3"}
8672
+ Rendered users/respond_with.xlsx.wb (7.6ms)
8673
+ Completed 200 OK in 8ms (Views: 8.1ms | ActiveRecord: 0.0ms)
8674
+ Started GET "/home/render_elsewhere.xlsx?type=2" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8675
+ Processing by HomeController#render_elsewhere as XLSX
8676
+ Parameters: {"type"=>"2"}
8677
+ Rendered users/respond_with.xlsx.wb (46.6ms)
8678
+ Rendered text template (0.0ms)
8679
+ Sent data respond_with.xlsx (0.4ms)
8680
+ Completed 200 OK in 48ms (Views: 47.6ms | ActiveRecord: 0.0ms)
8681
+ Started GET "/home/render_elsewhere.xlsx?type=1" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8682
+ Processing by HomeController#render_elsewhere as XLSX
8683
+ Parameters: {"type"=>"1"}
8684
+ Rendered users/respond_with.xlsx.wb (46.4ms)
8685
+ Rendered text template (0.0ms)
8686
+ Sent data index.xlsx (0.4ms)
8687
+ Completed 200 OK in 48ms (Views: 47.4ms | ActiveRecord: 0.0ms)
8688
+ Started GET "/home.xlsx" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8689
+ Processing by HomeController#index as XLSX
8690
+ Rendered home/index.xlsx.wb (45.9ms)
8691
+ Completed 200 OK in 47ms (Views: 46.3ms | ActiveRecord: 0.0ms)
8692
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8693
+ Processing by HomeController#index as CSV
8694
+ Rendered home/index.csv.wb (0.7ms)
8695
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
8696
+ Started GET "/home/generic.csv" for 127.0.0.1 at 2016-04-20 09:00:14 +0200
8697
+ Processing by HomeController#generic as CSV
8698
+ Completed 406 Not Acceptable in 0ms (ActiveRecord: 0.0ms)
8699
+ User Load (0.1ms) SELECT "users".* FROM "users"
8700
+  (0.0ms) begin transaction
8701
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 59]]
8702
+  (3062.5ms) commit transaction
8703
+  (0.1ms) begin transaction
8704
+ SQL (0.2ms) 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", "2016-04-20 07:00:17.886047"], ["updated_at", "2016-04-20 07:00:17.886047"]]
8705
+  (73663.0ms) commit transaction
8706
+ Started GET "/users/60.xlsx" for 127.0.0.1 at 2016-04-20 09:01:31 +0200
8707
+ Processing by UsersController#show as XLSX
8708
+ Parameters: {"id"=>"60"}
8709
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 60]]
8710
+ Rendered users/respond_with.xlsx.wb (12.8ms)
8711
+ Completed 200 OK in 17ms (Views: 16.2ms | ActiveRecord: 0.1ms)
8712
+ User Load (0.1ms) SELECT "users".* FROM "users"
8713
+  (0.0ms) begin transaction
8714
+ SQL (0.1ms) DELETE FROM "users" WHERE "users"."id" = ? [["id", 60]]
8715
+  (10553.8ms) commit transaction
8716
+  (0.1ms) begin transaction
8717
+ SQL (0.2ms) 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", "2016-04-20 07:01:42.226003"], ["updated_at", "2016-04-20 07:01:42.226003"]]
8718
+  (1072.8ms) commit transaction
8719
+  (0.1ms) begin transaction
8720
+ SQL (19.2ms) INSERT INTO "likes" ("name", "user_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "Carrots"], ["user_id", 61], ["created_at", "2016-04-20 07:01:44.256996"], ["updated_at", "2016-04-20 07:01:44.256996"]]
8721
+  (1947.0ms) commit transaction
8722
+  (0.1ms) begin transaction
8723
+ SQL (0.2ms) INSERT INTO "likes" ("name", "user_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "Celery"], ["user_id", 61], ["created_at", "2016-04-20 07:01:46.226346"], ["updated_at", "2016-04-20 07:01:46.226346"]]
8724
+  (2664.2ms) commit transaction
8725
+ Started GET "/users/61/likes.xlsx" for 127.0.0.1 at 2016-04-20 09:01:48 +0200
8726
+ Processing by LikesController#index as XLSX
8727
+ Parameters: {"user_id"=>"61"}
8728
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 61]]
8729
+ Like Load (0.2ms) SELECT "likes".* FROM "likes" WHERE "likes"."user_id" = ? [["user_id", 61]]
8730
+ Rendered likes/index.xlsx.wb (8.8ms)
8731
+ Completed 200 OK in 11ms (Views: 9.6ms | ActiveRecord: 0.3ms)
8732
+  (0.1ms) begin transaction
8733
+ SQL (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", "2016-04-20 07:01:48.959250"], ["updated_at", "2016-04-20 07:01:48.959250"]]
8734
+  (2705.2ms) commit transaction
8735
+ Started GET "/users/62/send_instructions" for 127.0.0.1 at 2016-04-20 09:01:51 +0200
8736
+ Processing by UsersController#send_instructions as HTML
8737
+ Parameters: {"user_id"=>"62"}
8738
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 62]]
8739
+ Rendered users/mailers/instructions.xlsx.wb (10.7ms)
8740
+ Rendered notifier/instructions.html.erb (0.4ms)
8741
+
8742
+ Notifier#instructions: processed outbound mail in 1372.9ms
8743
+
8744
+ Sent mail to elmer@fudd.com (119.3ms)
8745
+ Date: Wed, 20 Apr 2016 09:01:53 +0200
8746
+ From: noreply@company.com
8747
+ To: elmer@fudd.com
8748
+ Message-ID: <571729612dd77_19b312d5e8c7916d@chakra.mail>
8749
+ Subject: Instructions
8750
+ Mime-Version: 1.0
8751
+ Content-Type: multipart/mixed;
8752
+ boundary="--==_mimepart_571729611c611_19b312d5e8c790b8";
8753
+ charset=UTF-8
8754
+ Content-Transfer-Encoding: 7bit
8755
+
8756
+
8757
+ ----==_mimepart_571729611c611_19b312d5e8c790b8
8758
+ Content-Type: text/html;
8759
+ charset=UTF-8
8760
+ Content-Transfer-Encoding: 7bit
8761
+
8762
+ <!DOCTYPE html>
8763
+ <html>
8764
+ <head>
8765
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
8766
+ </head>
8767
+ <body>
8768
+ <h1>Instructions</h1>
8769
+ <p>
8770
+ You have successfully signed up to example.com,
8771
+ your username is: elmer@fudd.com.<br/>
8772
+ </p>
8773
+ <p>Thanks for joining and have a great day!</p>
8774
+ </body>
8775
+ </html>
8776
+
8777
+ ----==_mimepart_571729611c611_19b312d5e8c790b8
8778
+ Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
8779
+ Content-Transfer-Encoding: base64
8780
+ Content-Disposition: attachment;
8781
+ filename=user_62.xlsx
8782
+ Content-ID: <57172961395cb_19b312d5e8c792d6@chakra.mail>
8783
+
8784
+ UEsDBBQAAAAIAAAIIexP8WLf1wAAAEACAAALAAAAX3JlbHMvLnJlbHOtksFO
8785
+ wzAMhl8l8n1NNySE0LJdJqTdECoPYBK3jdrEUWKgvD2BA2JoCA47Wvb//d/B
8786
+ 2/0SZvVCuXiOBtZNC4qiZefjYOCxu1vdwH63faAZpV6U0aeiaiQWA6NIutW6
8787
+ 2JECloYTxbrpOQeUOuZBJ7QTDqQ3bXut83cGnDJVh3kgMbDM+pXz9MQ8NRUG
8788
+ qntL9J8q7ntv6cD2OVCUM40/LkAdnYF8dGvQv7g4tveZa9JypkvbBBJ0KPgJ
8789
+ X6XaQ1k8lS+vzd9emNKltWgRio7cOaOrDyN98gq7d1BLAwQUAAAACAAACCHs
8790
+ sD0zOPIBAAD2BQAADQAAAHhsL3N0eWxlcy54bWylVF1rpTAQ/SshP2Cjl25h
8791
+ Lyp0F4RCtxTah32NGj8gH5LEovvrd5JYjbTlXro+mJnjnDNjZpLM2IWz554x
8792
+ i2bBpclxb+14JsTUPRPUfFMjk/ClVVpQC67uiBk1o41xJMHJKUluiaCDxEUm
8793
+ J1EKa1CtJm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EAAACkgRAFAAB4
8858
+ bC9fcmVscy93b3JrYm9vay54bWwucmVsc1BLAQI0AxQAAAAIAAAIIez2i56h
8859
+ IAEAAIQDAAATAAAAAAAAAAEAAACkgQAGAABbQ29udGVudF9UeXBlc10ueG1s
8860
+ UEsBAjQDFAAAAAgAAAgh7KS9T6DHAAAANQEAAA8AAAAAAAAAAQAAAKSBUQcA
8861
+ AHhsL3dvcmtib29rLnhtbFBLAQI0AxQAAAAIAAAIIew9WGI8cAAAAIoAAAAj
8862
+ AAAAAAAAAAEAAACkgUUIAAB4bC93b3Jrc2hlZXRzL19yZWxzL3NoZWV0MS54
8863
+ bWwucmVsc1BLAQI0AxQAAAAIAAAIIexKQxNwtgIAAGYGAAAYAAAAAAAAAAEA
8864
+ AACkgfYIAAB4bC93b3Jrc2hlZXRzL3NoZWV0MS54bWxQSwUGAAAAAAkACQBO
8865
+ AgAA4gsAAAAA
8866
+
8867
+ ----==_mimepart_571729611c611_19b312d5e8c790b8--
8868
+
8869
+ Rendered text template (0.0ms)
8870
+ Completed 200 OK in 1569ms (Views: 0.5ms | ActiveRecord: 0.1ms)
8871
+ Started GET "/home/generic.csv" for 127.0.0.1 at 2016-04-20 09:04:04 +0200
8872
+ Processing by HomeController#generic as CSV
8873
+ Completed 406 Not Acceptable in 0ms (ActiveRecord: 0.0ms)
8874
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:04:04 +0200
8875
+ Processing by HomeController#index as CSV
8876
+ Rendered home/index.csv.wb (0.8ms)
8877
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
8878
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:05:11 +0200
8879
+ Processing by HomeController#index as CSV
8880
+ Rendered home/index.csv.wb (1.0ms)
8881
+ Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)
8882
+ Started GET "/home/generic.csv" for 127.0.0.1 at 2016-04-20 09:05:11 +0200
8883
+ Processing by HomeController#generic as CSV
8884
+ Rendered home/generic.wb (0.7ms)
8885
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
8886
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:29:55 +0200
8887
+ Processing by HomeController#index as CSV
8888
+ Rendered home/index.csv.wb (0.9ms)
8889
+ Completed 200 OK in 113ms (Views: 113.1ms | ActiveRecord: 0.0ms)
8890
+ Started GET "/home/generic.csv" for 127.0.0.1 at 2016-04-20 09:40:08 +0200
8891
+ Processing by HomeController#generic as CSV
8892
+ Rendered home/generic.wb (0.9ms)
8893
+ Completed 200 OK in 7ms (Views: 6.5ms | ActiveRecord: 0.0ms)
8894
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:40:08 +0200
8895
+ Processing by HomeController#index as CSV
8896
+ Rendered home/index.csv.wb (0.6ms)
8897
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
8898
+ Started GET "/home.csv" for 127.0.0.1 at 2016-04-20 09:44:38 +0200
8899
+ Processing by HomeController#index as CSV
8900
+ Rendered home/index.csv.wb (0.8ms)
8901
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
8902
+ Started GET "/home/generic.csv" for 127.0.0.1 at 2016-04-20 09:44:38 +0200
8903
+ Processing by HomeController#generic as CSV
8904
+ Rendered home/generic.wb (0.6ms)
8905
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms)
@@ -4,6 +4,7 @@ describe 'Workbook renderer' do
4
4
  it "is registered" do
5
5
  ActionController::Renderers::RENDERERS.include?(:xlsx)
6
6
  ActionController::Renderers::RENDERERS.include?(:xls)
7
+ ActionController::Renderers::RENDERERS.include?(:csv)
7
8
  end
8
9
 
9
10
  it "has xlsx mime type" do
@@ -18,4 +19,10 @@ describe 'Workbook renderer' do
18
19
  expect(Mime::XLS.to_s).to eq("application/vnd.ms-excel")
19
20
  end
20
21
 
22
+ it "has csv mime type" do
23
+ expect(Mime::CSV).to be
24
+ expect(Mime::CSV.to_sym).to eq(:csv)
25
+ expect(Mime::CSV.to_s).to eq("text/csv")
26
+ end
27
+
21
28
  end
@@ -23,6 +23,14 @@ describe 'Workbook request', :type => :request do
23
23
  expect(wb.sheet.table[1][0]).to eq('Untie!')
24
24
  end
25
25
 
26
+ it "downloads an csv file from default respond_to" do
27
+ visit '/home.csv'
28
+
29
+ expect(page.response_headers['Content-Type']).to eq(Mime::CSV.to_s + "; charset=utf-8")
30
+ wb = write_and_open_workbook(page, 'csv')
31
+ expect(wb.sheet.table[1][0]).to eq('Untie!')
32
+ end
33
+
26
34
  it "downloads an excel file from params format" do
27
35
  visit '/home/generic.xlsx'
28
36
 
@@ -39,6 +47,14 @@ describe 'Workbook request', :type => :request do
39
47
  expect(wb.sheet.table[1][0]).to eq('Untie!')
40
48
  end
41
49
 
50
+ it "downloads an csv file from params format" do
51
+ visit '/home/generic.csv'
52
+
53
+ expect(page.response_headers['Content-Type']).to eq(Mime::CSV.to_s + "; charset=utf-8")
54
+ wb = write_and_open_workbook(page, 'csv')
55
+ expect(wb.sheet.table[1][0]).to eq('Untie!')
56
+ end
57
+
42
58
  it "downloads an excel file from respond_to while specifying filename" do
43
59
  visit '/useheader.xlsx'
44
60
 
@@ -162,7 +178,7 @@ describe 'Workbook request', :type => :request do
162
178
  File.open(file, 'wb') {|f| f.write(page.source) }
163
179
  wb = nil
164
180
  expect{ wb = Workbook::Book.open(file) }.to_not raise_error
165
- File.unlink file
181
+ #File.unlink file
166
182
  wb
167
183
  end
168
184
  end
metadata CHANGED
@@ -1,181 +1,181 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workbook_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noel Peden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: workbook
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.4.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: capybara
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sqlite3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: growl
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rb-fsevent
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: coveralls
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pry
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: pry-nav
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: Workbook_Rails provides a Workbook renderer so you can move all your
@@ -214,6 +214,7 @@ files:
214
214
  - spec/dummy/app/models/user.rb
215
215
  - spec/dummy/app/views/home/_cover_sheet.xlsx.wb
216
216
  - spec/dummy/app/views/home/generic.wb
217
+ - spec/dummy/app/views/home/index.csv.wb
217
218
  - spec/dummy/app/views/home/index.html.erb
218
219
  - spec/dummy/app/views/home/index.xls.wb
219
220
  - spec/dummy/app/views/home/index.xlsx.wb
@@ -278,12 +279,12 @@ require_paths:
278
279
  - lib
279
280
  required_ruby_version: !ruby/object:Gem::Requirement
280
281
  requirements:
281
- - - '>='
282
+ - - ">="
282
283
  - !ruby/object:Gem::Version
283
284
  version: '0'
284
285
  required_rubygems_version: !ruby/object:Gem::Requirement
285
286
  requirements:
286
- - - '>='
287
+ - - ">="
287
288
  - !ruby/object:Gem::Version
288
289
  version: '0'
289
290
  requirements: []
@@ -316,6 +317,7 @@ test_files:
316
317
  - spec/dummy/app/views/home/_cover_sheet.xlsx.wb
317
318
  - spec/dummy/app/views/home/index.xlsx.wb
318
319
  - spec/dummy/app/views/home/useheader.xlsx.wb
320
+ - spec/dummy/app/views/home/index.csv.wb
319
321
  - spec/dummy/app/views/layouts/application.html.erb
320
322
  - spec/dummy/app/views/likes/index.html.erb
321
323
  - spec/dummy/app/views/likes/index.xlsx.wb