Skip to content

Instantly share code, notes, and snippets.

@stve
Created April 2, 2012 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stve/2287382 to your computer and use it in GitHub Desktop.
Save stve/2287382 to your computer and use it in GitHub Desktop.
# encoding: utf-8
require 'rails/railtie'
module Development
module Environment
class Railtie < ::Rails::Railtie
config.before_initialize do
env_path = File.expand_path("../../.env", __FILE__)
if File.exist?(env_path)
File.open(env_path) do |file|
file.each do |line|
variable, value = line.split('=')
ENV[variable] = value.chomp
end
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment