zh / redmine_importer

Redmine importer that works with trunk.
https://github.com/leovitch/redmine_importer/wiki
48 stars 57 forks source link

Create Gemfile #12

Closed cforce closed 10 years ago

zh commented 11 years ago

'fastercsv' is needed only for ruby 1.8.x. In ruby 1.9.x, it is the standard CSV library, required with 'csv'. So better to be something like (not tested):

Gemfile:

gem 'fastercsv', :platforms => :mri_18

_app/controller/importercontroller.rb

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
zh commented 10 years ago

No movement on that request, so closing it.