I can open a local file with wildcard characters like this:
require 'nokogiri'
require 'open-uri'
Dir.glob(Rails.root.join("public/system/xmls/**/original/*.xml")).each do |path|
File.open(path) do |f|
doc = Nokogiri::XML(f)
#etc
But this doesn’t work of course:
Dir.glob("https://s3-eu-west-1.amazonaws.com/foldername/xmlimports/**/*.xml").each do |path| #etc
URL’s don’t offer a standardized way of listing a directory’s contents, so it’s impossible to write a glob handler that’ll work for any URL. You’ll have to roll your own glob handler for this particular case, or rely on something like
wgetto mirror the entire directory and glob the files locally (but that would be a bizarre approach if the files are large and/or you need to process just few of them).