diff options
author | rautenberg <rautenberg@in-silico.ch> | 2014-10-17 09:53:14 +0200 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2014-10-17 09:53:14 +0200 |
commit | af91fbee05397b82874d5889f3783cbc28da3048 (patch) | |
tree | 3f66c53168c6b1c1c45593c677c4e0a0582548c6 | |
parent | 30e213383d432536c252dd237cdeab96973411e6 (diff) |
remove fixed roo version and update code to new roo API
-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" |