diff --git a/generators/tasks/templates/common.rake b/generators/tasks/templates/common.rake index fb2a118f..f2e49bf4 100644 --- a/generators/tasks/templates/common.rake +++ b/generators/tasks/templates/common.rake @@ -4,4 +4,4 @@ require 'howitzer/gmail_api/client' desc 'Provides url to authorize application for gmail API usage' task :'gmail-init' do Howitzer::GmailApi::Client.new -end \ No newline at end of file +end diff --git a/lib/howitzer/gmail_api/client.rb b/lib/howitzer/gmail_api/client.rb index cda0d60c..0d4bb364 100644 --- a/lib/howitzer/gmail_api/client.rb +++ b/lib/howitzer/gmail_api/client.rb @@ -15,6 +15,8 @@ class Client 'howitzer-gmail.yaml') SCOPE = [Google::Apis::GmailV1::AUTH_GMAIL_MODIFY].freeze USER_ID = 'me'.freeze + MESSAGE = ColorizedString.new('Open the following URL in the browser and enter the ' \ + 'resulting code after authorization').yellow def initialize @service = Google::Apis::GmailV1::GmailService.new @@ -57,8 +59,7 @@ def authorize url = authorizer.get_authorization_url( base_url: OOB_URI ) - puts ColorizedString.new('Open the following URL in the browser and enter the ' \ - 'resulting code after authorization').yellow + puts MESSAGE puts url code = $stdin.gets credentials = authorizer.get_and_store_credentials_from_code(