send_csv 0.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/send_csv.rb +8 -3
- metadata +3 -3
data/lib/send_csv.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
module SendCsv
|
2
|
-
VERSION = '0.
|
2
|
+
VERSION = '0.2'
|
3
3
|
end
|
4
4
|
|
5
|
-
|
5
|
+
require 'action_controller' # Make sure ActionController::Base is defined
|
6
|
+
|
7
|
+
ActionController::Base.class_eval do
|
8
|
+
private
|
9
|
+
|
6
10
|
def send_csv(lines, options = {})
|
11
|
+
require 'csv'
|
12
|
+
|
7
13
|
options = options.dup
|
8
14
|
encoding = options.delete(:encoding) || 'ISO-8859-1'
|
9
15
|
|
@@ -18,4 +24,3 @@ class ApplicationController
|
|
18
24
|
send_data csv, options
|
19
25
|
end
|
20
26
|
end
|
21
|
-
|
metadata
CHANGED