Просмотр исходного кода

add comments and more setup instructions

Ben Cornelis 9 лет назад
Родитель
Сommit
ba323f437b

+ 2 - 1
app/concerns/evernote_concern.rb

@@ -16,7 +16,8 @@ module EvernoteConcern
       token:           evernote_oauth_token,
       consumer_key:    evernote_consumer_key,
       consumer_secret: evernote_consumer_secret,
-      sandbox: false
+      # set to false in production
+      sandbox: true
     )
   end
 

+ 5 - 1
app/models/agents/evernote_agent.rb

@@ -5,7 +5,11 @@ module Agents
     description <<-MD
       The Evernote Agent connects with a user's Evernote note store.
 
-      To be able to use this agent with your account you need to authenticate with Evernote in the [Services](/services) section.
+      Visit [Evernote](https://dev.evernote.com/doc/) to set up an Evernote app and receive an api key and secret.
+      Store these in the Evernote environment variables in the .env file.
+      You will also need to create a [Sandbox](https://sandbox.evernote.com/Registration.action) account to use during development.
+
+      Next, you'll need to authenticate with Evernote in the [Services](/services) section.
 
       Options:
 

+ 4 - 4
config/initializers/devise.rb

@@ -266,11 +266,11 @@ Devise.setup do |config|
   if defined?(OmniAuth::Strategies::Evernote) &&
     (key = ENV["EVERNOTE_OAUTH_KEY"]).present? &&
     (secret = ENV["EVERNOTE_OAUTH_SECRET"]).present?
-    # for production:
-    config.omniauth :evernote, key, secret
-
     # for development:
-    # config.omniauth :evernote, key, secret, client_options: { :site => 'https://sandbox.evernote.com' }
+    config.omniauth :evernote, key, secret, client_options: { :site => 'https://sandbox.evernote.com' }
+    
+    # for production:
+    # config.omniauth :evernote, key, secret
   end
 
   # ==> Warden configuration