transloadit/rails-sdk — pull request #18 by scudco (2011-11-11 22:14:49+00:00)
Title: Process config file with ERB to allow dynamic configs

Unless I'm missing something, I needed to do this so that I could store my Transload.it and S3 keys on Heroku and obviously not store them in the actual config.

FYI this may be introducing a regression, because I wasn't sure why the current gem uses self.application.root.join rather than just loading the file.

So here's what my config looks like now:

auth:
key : <%= ENV['TRANSLOADIT_KEY'] %>
secret : <%= ENV['TRANSLOADIT_SECRET'] %>
duration: 1800 # 30 minute validity period for signed upload forms

templates:
store_and_resize:
steps:
export:
robot: "/s3/store"
key: <%= ENV['AWS_S3_KEY'] %>
secret: <%= ENV['AWS_S3_SECRET'] %>
bucket: <%= ENV['AWS_S3_BUCKET'] %>
thumb:
robot: "/image/resize"
width: 330
height: 230
resize_strategy: "pad"
background: "#fff"