Permalink
Browse files

setup api keys based on Rails.env

  • Loading branch information...
1 parent 5974ba2 commit 42eed01552806b1fe627cf32cb39c1f05873d3ef @RudyOnRails committed Apr 23, 2012
Showing with 14 additions and 3 deletions.
  1. +2 −1 app/views/layouts/application.html.haml
  2. +6 −1 config/initializers/omniauth.rb
  3. +6 −1 config/initializers/wordnik.rb
@@ -7,7 +7,8 @@
%body
%header#header
.container
- %h1= link_to 'Wordzies', :dashboard
+ %h1
+ = link_to 'Wordzies', :dashboard
#signin
- if logged_in
%span
@@ -1,3 +1,8 @@
Rails.application.config.middleware.use OmniAuth::Builder do
- provider :twitter, API_KEYS['TWITTER_CONSUMER_KEY'], API_KEYS['TWITTER_CONSUMER_SECRET']
+
+ if Rails.env == "production"
+ provider :twitter, ENV['WORDZIES_TWITTER_CONSUMER_KEY'], ENV['WORDZIES_TWITTER_CONSUMER_SECRET']
+ else
+ provider :twitter, API_KEYS['WORDZIES_TWITTER_CONSUMER_KEY'], API_KEYS['WORDZIES_TWITTER_CONSUMER_SECRET']
+ end
end
@@ -1,5 +1,10 @@
Wordnik.configure do |config|
- config.api_key = API_KEYS['WORDNIK_API_KEY'] # required
+
+ if Rails.env = "production"
+ config.api_key = ENV['WORDZIES_WORDNIK_API_KEY'] # required
+ else
+ config.api_key = API_KEYS['WORDZIES_WORDNIK_API_KEY'] # required
+ end
# config.username = 'bozo' # optional, but needed for user-related functions
# config.password = 'cl0wnt0wn' # optional, but needed for user-related functions
config.response_format = 'json' # defaults to json, but xml is also supported

0 comments on commit 42eed01

Please sign in to comment.