Skip to content

Commit

Permalink
Added support for loading remote files over ftp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iainbeeston authored Dec 20, 2016
1 parent 0f67aa1 commit 4332445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/roo/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4332445

Please sign in to comment.