Permalink
Browse files

Make CSV generation code work in Ruby 1.9.

  • Loading branch information...
1 parent 6385352 commit 640dd40a8ad20ad4811b6aeba25d86d36ca4d98b @markoa markoa committed Feb 8, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 coming_soon.rb
View
@@ -2,6 +2,16 @@
require 'active_record'
require 'fastercsv'
+require 'csv'
+if CSV.const_defined? :Reader
+ # Ruby 1.8
+ require 'fastercsv'
+ CSVKLASS = FasterCSV
+else
+ # Ruby 1.9, FasterCSV merged in stdlib
+ CSVKLASS = CSV
+end
+
def load_configuration(file, name)
if !File.exist?(file)

0 comments on commit 640dd40

Please sign in to comment.