From 08558383ec6bd866baabd78a591e42a38697087b Mon Sep 17 00:00:00 2001 From: Tomas Mockus <107482602+MockusTravelTime@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:20:27 +0200 Subject: [PATCH] Add version to user agent (#20) * add version to user agent * 0.5.5 --- lib/travel_time/middleware/authentication.rb | 2 +- lib/travel_time/version.rb | 2 +- spec/travel_time/middleware/authentication_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/travel_time/middleware/authentication.rb b/lib/travel_time/middleware/authentication.rb index b4651b5..1c5cf15 100644 --- a/lib/travel_time/middleware/authentication.rb +++ b/lib/travel_time/middleware/authentication.rb @@ -14,7 +14,7 @@ class Authentication < Faraday::Middleware def on_request(env) env.request_headers[APP_ID_HEADER] = TravelTime.config.application_id env.request_headers[API_KEY_HEADER] = TravelTime.config.api_key - env.request_headers[USER_AGENT] = 'Travel Time Ruby SDK' + env.request_headers[USER_AGENT] = "Travel Time Ruby SDK #{TravelTime::VERSION}" end end end diff --git a/lib/travel_time/version.rb b/lib/travel_time/version.rb index 5dec5f0..9935388 100644 --- a/lib/travel_time/version.rb +++ b/lib/travel_time/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module TravelTime - VERSION = '0.5.4' + VERSION = '0.5.5' end diff --git a/spec/travel_time/middleware/authentication_spec.rb b/spec/travel_time/middleware/authentication_spec.rb index 353b541..666c783 100644 --- a/spec/travel_time/middleware/authentication_spec.rb +++ b/spec/travel_time/middleware/authentication_spec.rb @@ -25,7 +25,7 @@ it 'automatically adds User-Agent header' do middleware.on_request(faraday_env) value = faraday_env.request_headers[described_class::USER_AGENT] - expected = 'Travel Time Ruby SDK' + expected = "Travel Time Ruby SDK #{TravelTime::VERSION}" expect(value).to eq(expected) end end