Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Interactive fog session: how to get a bunch of signed URLs for European buckets with fog 0.4.1
require 'active_support/time'
bucket = {|d| d.key == 'my_bucket'}
files = {|f| f.content_length > 0 &&
f.key =~ %r{client-name.*\.zip}}
expiration =
signed_urls = {|f| f.url(expiration)}
fixed_signed_url = do |su|
su.sub(%r{s3\.(.*)/my_bucket}, "my_bucket.s3.#{$1}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment