My customer has a coded a function that takes 20 boolean values and comes up with an integer result.
They did it with Excel, as a complex formula.
In a new ROR web application, am I better off recoding the whole thing in Ruby, or somehow calling the Excel formula?
I could try to contact a server-side instance of Excel or headless OpenOffice and communicate with it using JACOB or the OpenOffice API?
You can use the spreadsheet gem to read from the Excel file. Try the following code, using a sample file in the same directory called ss.xls which has 1 in A1, 2 in B1, and =A1+B1 in C1.
The
valuecall returns the last value for the cell that was calculated by Excel, with the above example it will output3.0Edit: Read more about the gem here: http://spreadsheet.rubyforge.org/GUIDE_txt.html
Edit 2: Of course, if you happen to be on Windows you will not need a gem; you just can use the win32ole library as described here: http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html