lib/roo/csv.rb in roo-2.3.1 vs lib/roo/csv.rb in roo-2.3.2
- old
+ new
@@ -58,10 +58,12 @@
if uri?(filename)
make_tmpdir do |tmpdir|
tmp_filename = download_uri(filename, tmpdir)
CSV.foreach(tmp_filename, options, &block)
end
+ elsif is_stream?(filename_or_stream)
+ CSV.new(filename_or_stream, options).each(&block)
else
CSV.foreach(filename, options, &block)
end
end
@@ -115,6 +117,8 @@
@cell[coord] = sanitize_value(value) if value.is_a?(::String)
end
@cleaned[sheet] = true
end
+
+ alias_method :filename_or_stream, :filename
end