csv_builder 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/README.rdoc +2 -8
- data/lib/csv_builder.rb +6 -4
- metadata +1 -1
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 1.1.6 release 2009-12-18
|
2
|
+
|
3
|
+
* Generate csv before setting headers so that errors are displayed in-browser instead of downloaded (Gabe da Silveira)
|
4
|
+
* Tweak README for gemcutter download. (Gabe da Silveira)
|
5
|
+
|
1
6
|
== 1.1.5 release 2009-12-18
|
2
7
|
|
3
8
|
* Do transliteration before exporting to CSV, not after (Tom Stuart)
|
data/README.rdoc
CHANGED
@@ -22,18 +22,12 @@ development/production machine.
|
|
22
22
|
|
23
23
|
Install as a gem:
|
24
24
|
|
25
|
-
$
|
25
|
+
$ gem install csv_builder
|
26
26
|
|
27
27
|
Then add the gem dependency in your config:
|
28
28
|
|
29
29
|
# config/environment.rb
|
30
|
-
config.gem "
|
31
|
-
|
32
|
-
=== Install as plugin
|
33
|
-
|
34
|
-
To install as a plugin, use:
|
35
|
-
|
36
|
-
$ ./script/plugin install git://github.com/mreinsch/csv_builder.git
|
30
|
+
config.gem "csv_builder"
|
37
31
|
|
38
32
|
|
39
33
|
== Example
|
data/lib/csv_builder.rb
CHANGED
@@ -34,6 +34,11 @@ module ActionView # :nodoc:
|
|
34
34
|
def compile(template)
|
35
35
|
<<-EOV
|
36
36
|
begin
|
37
|
+
output = FasterCSV.generate do |faster_csv|
|
38
|
+
csv = TransliteratingFilter.new(faster_csv)
|
39
|
+
#{template.source}
|
40
|
+
end
|
41
|
+
|
37
42
|
unless defined?(ActionMailer) && defined?(ActionMailer::Base) && controller.is_a?(ActionMailer::Base)
|
38
43
|
@filename ||= "\#{controller.action_name}.csv"
|
39
44
|
if controller.request.env['HTTP_USER_AGENT'] =~ /msie/i
|
@@ -49,10 +54,7 @@ module ActionView # :nodoc:
|
|
49
54
|
end
|
50
55
|
end
|
51
56
|
|
52
|
-
|
53
|
-
csv = TransliteratingFilter.new(faster_csv)
|
54
|
-
#{template.source}
|
55
|
-
end
|
57
|
+
output
|
56
58
|
rescue Exception => e
|
57
59
|
RAILS_DEFAULT_LOGGER.warn("Exception \#{e} \#{e.message} with class \#{e.class.name} thrown when rendering CSV")
|
58
60
|
raise e
|