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.
Files changed (2) hide show
  1. data/lib/send_csv.rb +8 -3
  2. metadata +3 -3
data/lib/send_csv.rb CHANGED
@@ -1,9 +1,15 @@
1
1
  module SendCsv
2
- VERSION = '0.1'
2
+ VERSION = '0.2'
3
3
  end
4
4
 
5
- class ApplicationController
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
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: send_csv
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- version: "0.1"
8
+ - 2
9
+ version: "0.2"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ouvrages