Skip to content

Instantly share code, notes, and snippets.

@edgar
Last active December 17, 2015 15:19
Show Gist options
  • Save edgar/5630642 to your computer and use it in GitHub Desktop.
Save edgar/5630642 to your computer and use it in GitHub Desktop.
Migrate from FasterCSV in ruby 1.8 to CSV in ruby 1.9+
require 'csv'
if CSV.const_defined? :Reader
# Ruby 1.8 compatible
require 'fastercsv'
Object.send(:remove_const, :CSV)
CSV = FasterCSV
else
# CSV is now FasterCSV in ruby 1.9
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment