Created
December 18, 2012 19:44
-
-
Save aclarke-iseatz/4331248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/string_inquirer' | |
module Farts | |
module Environment | |
def env | |
# only want to set this value if it doesn't already have one | |
file_name = '/Users/aclarke/tmp/environment' | |
# don't even bother to set this if it's already been set (||=) | |
@@_env_file ||= File.exists?(file_name) ? File.read(file_name).strip : "development" | |
@@_env ||= ActiveSupport::StringInquirer.new @@_env_file | |
end | |
end | |
end | |
class Poop | |
extend Farts::Environment | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment