Skip to content

Instantly share code, notes, and snippets.

@logicminds
Created September 27, 2013 18:31
Show Gist options
  • Save logicminds/6733062 to your computer and use it in GitHub Desktop.
Save logicminds/6733062 to your computer and use it in GitHub Desktop.
Simple key=value facts similar to how puppet uses facts.d
if File.exists?File.expand_path('~/.env_config')
File.open(File.expand_path('~/.env_config'), "r") do |file|
file.each_line do | line|
fact = line.split('=')
if fact.count > 1
Facter.add(fact.first.strip) do
setcode do
fact.last.strip
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment