Fixes error when importing xls files

XLS loader was crashing when trying to rename columns.

Upgrading roo solves the issue.
2.0
David Arango 12 years ago
parent 64ac254d74
commit db7501312d

@ -46,7 +46,7 @@ end
# Importer
gem "ruby-ole", "1.2.11.3"
gem "rchardet19", "1.3.5"
gem "roo", "1.9.7"
gem "roo", "1.11.2"
gem "spreadsheet", "0.6.5.9"
gem "google-spreadsheet-ruby", "0.1.8"
gem "rubyzip", "0.9.9"

@ -62,7 +62,6 @@ GEM
xpath (~> 0.1.4)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
choice (0.1.6)
chunky_png (1.2.8)
coderay (1.0.9)
columnize (0.3.6)
@ -128,7 +127,6 @@ GEM
addressable (~> 2.2.6)
libv8 (3.3.10.4)
listen (0.7.3)
log4r (1.1.10)
lumberjack (1.0.3)
mail (2.4.4)
i18n (>= 0.4.0)
@ -219,12 +217,10 @@ GEM
rgeo (>= 0.2.8)
rollbar (0.9.6)
multi_json (~> 1.5)
roo (1.9.7)
choice (>= 0.1.4)
google-spreadsheet-ruby (>= 0.1.5)
nokogiri (>= 1.5.0)
roo (1.11.2)
nokogiri
rubyzip
spreadsheet (> 0.6.4)
todonotes (>= 0.1.0)
rspec (2.10.0)
rspec-core (~> 2.10.0)
rspec-expectations (~> 2.10.0)
@ -280,8 +276,6 @@ GEM
thor (0.14.6)
tilt (1.3.6)
timecop (0.3.5)
todonotes (0.1.1)
log4r
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
@ -353,7 +347,7 @@ DEPENDENCIES
rgeo (= 0.3.2)
rgeo-geojson (= 0.2.1)
rollbar
roo (= 1.9.7)
roo (= 1.11.2)
rspec-rails (= 2.10.1)
ruby-ole (= 1.2.11.3)
rubyzip (= 0.9.9)

@ -37,11 +37,11 @@ module CartoDB
end #preprocessor_for
def xls
fix_carriage_returns_in_headers( Excel.new(origin_path) )
fix_carriage_returns_in_headers( Roo::Excel.new(origin_path) )
end #xls
def xlsx
fix_carriage_returns_in_headers( Excelx.new(origin_path) )
fix_carriage_returns_in_headers( Roo::Excelx.new(origin_path) )
end #xlsx
def ods
@ -51,7 +51,6 @@ module CartoDB
def fix_carriage_returns_in_headers(data)
g = Array.new
data.row(1).each{ |cell| g << cell.gsub('\n', '').strip }
if data.row(1) != g
cell_count = 1

@ -15,9 +15,9 @@ else
when '.odt'
Openoffice.new(ARGV[0])
when '.xls'
Excel.new(ARGV[0])
Roo::Excel.new(ARGV[0])
when '.xlsx'
Excelx.new(ARGV[0])
Roo::Excelx.new(ARGV[0])
end
s.to_csv("/tmp/#{csv_name}.csv")
puts "/tmp/#{csv_name}.csv"

Loading…
Cancel
Save