From 35bef8958803d3288e0823a5a9a50d58ee3ae4c5 Mon Sep 17 00:00:00 2001 From: Kazuhiro Serizawa Date: Sat, 25 Feb 2017 22:55:15 +0900 Subject: [PATCH] rubocop autocorrect: Favor a normal if-statement --- lib/googleauth/user_authorizer.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/googleauth/user_authorizer.rb b/lib/googleauth/user_authorizer.rb index b913dad..68fea74 100644 --- a/lib/googleauth/user_authorizer.rb +++ b/lib/googleauth/user_authorizer.rb @@ -267,10 +267,12 @@ module Google # Redirect URI def redirect_uri_for(base_url) return @callback_uri unless URI(@callback_uri).scheme.nil? - raise sprintf( - MISSING_ABSOLUTE_URL_ERROR, - @callback_uri - ) if base_url.nil? || URI(base_url).scheme.nil? + if base_url.nil? || URI(base_url).scheme.nil? + raise sprintf( + MISSING_ABSOLUTE_URL_ERROR, + @callback_uri + ) + end URI.join(base_url, @callback_uri).to_s end end