From 4332445bbba1bee08f0180c53189deabc3cd8987 Mon Sep 17 00:00:00 2001 From: Iain Beeston Date: Tue, 20 Dec 2016 10:55:54 +0000 Subject: [PATCH] Added support for loading remote files over ftp Roo uses open-uri to load remote files. Open-uri can download files over both http and ftp, however, roo was short-circuiting this and only loading open-uri if the uri started with "http://" or "https://". I've modified this check to also allow "ftp://" uris to be loaded. It would have been nice to do this more dynamically, by "asking" open-uri what protocols it supports, but there doesn't seem to be a way to do this in open-uri at present. --- lib/roo/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/roo/base.rb b/lib/roo/base.rb index 105a5466..5eece0d0 100644 --- a/lib/roo/base.rb +++ b/lib/roo/base.rb @@ -605,7 +605,7 @@ def normalize(row, col) end def uri?(filename) - filename.start_with?('http://', 'https://') + filename.start_with?('http://', 'https://', 'ftp://') rescue false end