lib/io_streams/xlsx/reader.rb in iostreams-0.9.1 vs lib/io_streams/xlsx/reader.rb in iostreams-0.10.0
- old
+ new
@@ -11,19 +11,15 @@
# IOStreams::Xlsx::Reader.open('spreadsheet.xlsx') do |spreadsheet_stream|
# spreadsheet_stream.each_line do |line|
# puts line
# end
# end
- def self.open(file_name_or_io, options={}, &block)
+ def self.open(file_name_or_io, buffer_size: 65536, &block)
begin
require 'creek' unless defined?(Creek::Book)
rescue LoadError => e
raise(LoadError, "Please install the 'creek' gem for xlsx streaming support. #{e.message}")
end
-
- options = options.dup
- buffer_size = options.delete(:buffer_size) || 65536
- raise(ArgumentError, "Unknown IOStreams::Xlsx::Reader option: #{options.inspect}") if options.size > 0
if IOStreams.reader_stream?(file_name_or_io)
temp_file = Tempfile.new('rocket_job_xlsx')
file_name = temp_file.to_path