Skip to content

Commit

Permalink
Keep API keys out of source control.
Browse files Browse the repository at this point in the history
  • Loading branch information
spraints committed Feb 18, 2011
1 parent ec764d8 commit 4b7c3d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ db/*.sqlite3
log/*.log
tmp/
.*.swp
.omnisocial.yml
16 changes: 14 additions & 2 deletions config/initializers/omnisocial.rb
Expand Up @@ -9,11 +9,23 @@
if Rails.env.production?

# Configs for production mode go here
config.twitter ENV['TWITTER_APP_KEY'], ENV['TWITTER_APP_SECRET']

elsif Rails.env.development?

# Configs for development mode go here

begin
keys = YAML::load open(Pickardayune::Application.config.root + '.omnisocial.yml')
keys.each do |provider, keys|
config.send provider, *keys
end
rescue => e
puts "NO OMNISOCIAL CONFIGURATION HAS BEEN DONE!"
puts "Unable to load omnisocial config from .omnisocial.yml. Example:"
puts " twitter: [ 'appkey', 'appsecret' ]"
puts " facebook: [ 'appkey', 'appsecret', { :scope: publish_stream } ]"
puts e
end

end

end

0 comments on commit 4b7c3d9

Please sign in to comment.