-veefw
Last Updated: February 25, 2016
·
398
· xjunior

Heroku environment target

desc 'Set up heroku env'
task :heroku do
  Bundler.with_clean_env{ `heroku config | tail -n+2 | awk '{ print $1 $2 }'`.chop }.each_line do |env_var|
    var, value = env_var.split(':', 2)
    ENV[var.strip] = value.strip
  end
end

Then you can run your targets like:

rake heroku db:seed