summaryrefslogtreecommitdiff
path: root/lib/google_api
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2017-12-04 13:43:45 +0100
committerMatija Čupić <matteeyah@gmail.com>2017-12-04 13:43:45 +0100
commitbb80d439f4bbb37032a2ee2d35ee5eab7594de7d (patch)
tree6c5bfd4a8057a5f479a99741b42e74f40e4fc9f4 /lib/google_api
parent68b43f4d9c5dbc2d8264e5cadb7417e21ac0ed27 (diff)
downloadgitlab-ce-bb80d439f4bbb37032a2ee2d35ee5eab7594de7d.tar.gz
Refactor GCP Client#user_agent_header to use #tap
Diffstat (limited to 'lib/google_api')
-rw-r--r--lib/google_api/cloud_platform/client.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/google_api/cloud_platform/client.rb b/lib/google_api/cloud_platform/client.rb
index 36be6b7e97a..b0563fb2d69 100644
--- a/lib/google_api/cloud_platform/client.rb
+++ b/lib/google_api/cloud_platform/client.rb
@@ -84,9 +84,9 @@ module GoogleApi
end
def user_agent_header
- options = Google::Apis::RequestOptions.new
- options.header = { 'User-Agent': "GitLab/#{Gitlab::VERSION.match('(\d+\.\d+)').captures.first} (GPN:GitLab;)" }
- options
+ Google::Apis::RequestOptions.new.tap do |options|
+ options.header = { 'User-Agent': "GitLab/#{Gitlab::VERSION.match('(\d+\.\d+)').captures.first} (GPN:GitLab;)" }
+ end
end
end
end