Skip to content

Instantly share code, notes, and snippets.

@hindenbug
Created July 21, 2011 07:48

Revisions

  1. hindenbug revised this gist Aug 1, 2011. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,16 @@
    # in app/config/environment.rb

    require "csv"
    if CSV.const_defined? :Reader
    require "fastercsv" #for ruby 1.8
    Object.send(:remove_const, :CSV)
    CSV = FasterCSV
    else
    # use CSV for ruby 1.9
    end
    unless !CSV.const_defined? :Reader
    require "fastercsv"
    Object.send(:remove_const, :CSV)
    CSV = FasterCSV
    end

    #if CSV.const_defined? :Reader
    # require "fastercsv" #for ruby 1.8
    # Object.send(:remove_const, :CSV)
    # CSV = FasterCSV
    #else
    # # use CSV for ruby 1.9
    #end
  2. hindenbug revised this gist Jul 21, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # in Gemfile

    gem "fastercsv, :platforms => [:mri_18, :ruby_18]
    gem "fastercsv", :platforms => [:mri_18, :ruby_18]


    # in app/config/environment.rb
  3. hindenbug revised this gist Jul 21, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,13 @@
    gem "fastercsv, :platforms => [:mri_18, :ruby_18]
    #in app/config/environment.rb
    # in app/config/environment.rb
    require "csv"
    if CSV.const_defined? :Reader
    require "fastercsv" #for ruby 1.8
    Object.send(:remove_const, :CSV)
    CSV = FasterCSV
    else
    #use CSV for ruby 1.9
    # use CSV for ruby 1.9
    end
  4. hindenbug created this gist Jul 21, 2011.
    15 changes: 15 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # in Gemfile

    gem "fastercsv, :platforms => [:mri_18, :ruby_18]
    #in app/config/environment.rb
    require "csv"
    if CSV.const_defined? :Reader
    require "fastercsv" #for ruby 1.8
    Object.send(:remove_const, :CSV)
    CSV = FasterCSV
    else
    #use CSV for ruby 1.9
    end