lib/beso/csv.rb in beso-0.2.1 vs lib/beso/csv.rb in beso-0.3.0
- old
+ new
@@ -7,14 +7,20 @@
end
protected
def csv
- @csv ||= if require 'csv'
- ::CSV
- else
- require 'fastercsv'
- FasterCSV
+ @csv ||= Object.const_get( :CSV ) || begin
+ if require 'csv'
+ ::CSV
+ else
+ begin
+ require 'fastercsv'
+ FasterCSV
+ rescue
+ raise "Ruby version #{RUBY_VERSION} users need to require 'fastercsv'"
+ end
+ end
end
end
end
end