zenkay / simple-spreadsheet

Simple spreadsheet is a Ruby Gem reader for common spreadsheet formats: Excel (.xls, .xlsx), Open-office (.ods) and CSV (standard, excel, tab separated)
https://rubygems.org/gems/simple-spreadsheet
MIT License
98 stars 32 forks source link

Can't handle uppercased extensions #16

Closed pmontrasio closed 8 years ago

pmontrasio commented 8 years ago

I tried to open a .XLS file from Windows with an uppercased name and extension. The .read method returns nil. A quick inspection to the code finds this in lib/simple-spreadsheet.rb

  ext ||= File.extname(file)
  case ext
  when '.xls'
    ExcelReader.new(file)

Changing the first line into ext ||= File.extname(file).downcase fixes the issue.

zenkay commented 8 years ago

@pmontrasio Thanks for the tip. I fixed the issue on version 0.4.2. Best.