diff options
-rw-r--r-- | dataset.gemspec | 3 | ||||
-rw-r--r-- | helper.rb | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/dataset.gemspec b/dataset.gemspec index b31fa25..33e0e5d 100644 --- a/dataset.gemspec +++ b/dataset.gemspec @@ -18,7 +18,8 @@ Gem::Specification.new do |s| # specify any dependencies here; for example: s.add_runtime_dependency "opentox-server" - s.add_runtime_dependency "roo", "=1.10.1" # 1.10.2 is defunct + s.add_runtime_dependency "roo" + #, "=1.10.1" # 1.10.2 is defunct s.add_runtime_dependency "spreadsheet", "=0.9.0" s.add_runtime_dependency "rubyzip", "=0.9.9" # roo 1.10.1 do not work with rubyzip 1.0.0 s.add_runtime_dependency "openbabel"#, "~>2.3.1.5" @@ -19,7 +19,7 @@ module OpenTox end def from_spreadsheet spreadsheet - extensions = { Excel => ".xls", Excelx => ".xlsx", Openoffice => ".ods" } + extensions = { Roo::Excel => ".xls", Roo::Excelx => ".xlsx", Roo::Openoffice => ".ods" } input = params[:file][:tempfile].path + ".xls" csv_file = params[:file][:tempfile].path + ".csv" File.rename params[:file][:tempfile].path, input # roo needs "correct" extensions @@ -257,11 +257,11 @@ module OpenTox @body = from_csv @body @content_type = "text/plain" when "application/vnd.ms-excel", "application/excel" - from_spreadsheet Excel + from_spreadsheet Roo::Excel when "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - from_spreadsheet Excelx + from_spreadsheet Roo::Excelx when "application/vnd.oasis.opendocument.spreadsheet" - from_spreadsheet Openoffice + from_spreadsheet Roo::Openoffice # when "chemical/x-mdl-sdfile" # @body = parse_sdf @body # @content_type = "text/plain" |