Skip to content

Instantly share code, notes, and snippets.

@Sutto
Created June 14, 2013 13:43
Show Gist options
  • Save Sutto/5781893 to your computer and use it in GitHub Desktop.
Save Sutto/5781893 to your computer and use it in GitHub Desktop.
require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
# Uses forman to boostrap ENV from a .env environment.
# This is mostly useful since it means we can then use it from
# things other than foreman (passenger, our own scripts) with easy.
envfile_path = File.expand_path('../../.env', __FILE__)
if File.exists?(envfile_path)
require 'foreman/env'
STDERR.puts "Loading foreman environment file."
Foreman::Env.new(envfile_path).entries do |key, value|
ENV[key] = value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment