Last active
December 17, 2015 15:19
-
-
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+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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