I'm trying to open a file from a URL using roo (1.11.0)
Foobazs-iMac:pipeline foobazlabs$ irb
irb(main):001:0> require 'roo'
require '=> true
irb(main):002:0> require 'open-uri'
=> true
irb(main):003:0> Roo::Excelx.new(open("https://www.filepicker.io/api/file/xPxn6cu3RZuQdgrx4y72"))
NoMethodError: undefined method `start_with?' for #<Tempfile:0x007ffd091d25c8>
but it looks like there isn't support for this using roo (it accepts only path names)
Can't use a temp file path name either
irb(main):004:0> t = Tempfile.new('temp.xlsx')
=> #<File:/var/folders/q_/q738l9cj3xl90yfs1g8wc4200000gn/T/temp.xlsx20130317-2753-1p3l5l6>
irb(main):005:0> t.binmode
irb(main):006:0> open("https://www.filepicker.io/api/file/xPxn6cu3RZuQdgrx4y72") { |data| t.write data.read }
=> 13494
irb(main):007:0> Roo::Excelx.new(t.path)
use Roo::Excelx.new to handle .xlsx spreadsheet files. This has .xlsx20130317-2753-1p3l5l6
TypeError: /var/folders/q_/q738l9cj3xl90yfs1g8wc4200000gn/T/temp.xlsx20130317-2753-1p3l5l6 is not an Excel-xlsx file
Any Ruby library/gem that I can use for this purpose? I only need to read xls and xlsx files. I don't need to write. Since I'm on Heroku, I can only use Tempfiles not actual Files.