From 877aab13ee2ed00ddb1ecbc2d01dae96fcf9e062 Mon Sep 17 00:00:00 2001 From: bodrovis Date: Thu, 13 Jun 2024 20:00:01 +0300 Subject: [PATCH] minor updates --- .rubocop.yml | 7 ------- lib/ruby_lokalise_api/client.rb | 2 +- lib/ruby_lokalise_api/endpoints/main_endpoint.rb | 2 +- lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb | 2 +- lib/ruby_lokalise_api/error.rb | 2 +- lib/ruby_lokalise_api/oauth2_client.rb | 2 +- ruby-lokalise-api.gemspec | 2 +- 7 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4abb387..532457d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -58,13 +58,6 @@ RSpec/SpecFilePathFormat: OAuth2Client: oauth2_client OAuth2Token: oauth2_token OAuth2RefreshedToken: oauth2_refreshed_token - -RSpec/FilePath: - CustomTransform: - OAuth2: oauth2 - OAuth2Client: oauth2_client - OAuth2Token: oauth2_token - OAuth2RefreshedToken: oauth2_refreshed_token Gemspec/DevelopmentDependencies: EnforcedStyle: gemspec diff --git a/lib/ruby_lokalise_api/client.rb b/lib/ruby_lokalise_api/client.rb index 3a1c76d..7e8884d 100644 --- a/lib/ruby_lokalise_api/client.rb +++ b/lib/ruby_lokalise_api/client.rb @@ -4,7 +4,7 @@ module RubyLokaliseApi # Regular API client used to perform requests with a basic API token class Client < BaseClient def initialize(token, params = {}) - super(token, params) + super @token_header = 'x-api-token' end diff --git a/lib/ruby_lokalise_api/endpoints/main_endpoint.rb b/lib/ruby_lokalise_api/endpoints/main_endpoint.rb index 0014e22..38701ef 100644 --- a/lib/ruby_lokalise_api/endpoints/main_endpoint.rb +++ b/lib/ruby_lokalise_api/endpoints/main_endpoint.rb @@ -6,7 +6,7 @@ class MainEndpoint < BaseEndpoint BASE_URL = 'https://api.lokalise.com/api2' def initialize(client, params = {}) - super(client, params) + super @uri = partial_uri(base_query(*@query_params)) end diff --git a/lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb b/lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb index f340205..c8d7806 100644 --- a/lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb +++ b/lib/ruby_lokalise_api/endpoints/oauth2/oauth2_endpoint.rb @@ -8,7 +8,7 @@ class OAuth2Endpoint < BaseEndpoint PARTIAL_URI_TEMPLATE = '{/segments*}{?query*}' def initialize(client, params = {}) - super(client, params) + super @uri = partial_uri(base_query(*@query_params), params.fetch(:get, [])) end diff --git a/lib/ruby_lokalise_api/error.rb b/lib/ruby_lokalise_api/error.rb index 338c089..7419f07 100644 --- a/lib/ruby_lokalise_api/error.rb +++ b/lib/ruby_lokalise_api/error.rb @@ -52,7 +52,7 @@ def from_response(body) # Initializes a new Error object def initialize(message = '') - super(message) + super end end end diff --git a/lib/ruby_lokalise_api/oauth2_client.rb b/lib/ruby_lokalise_api/oauth2_client.rb index d531fa8..b0e9587 100644 --- a/lib/ruby_lokalise_api/oauth2_client.rb +++ b/lib/ruby_lokalise_api/oauth2_client.rb @@ -4,7 +4,7 @@ module RubyLokaliseApi # Client used to perform API requests with an OAuth2 access token class OAuth2Client < Client def initialize(token, params = {}) - super(token, params) + super @token_header = 'Authorization' @token = "Bearer #{@token}" end diff --git a/ruby-lokalise-api.gemspec b/ruby-lokalise-api.gemspec index 5fb3322..9fc1971 100644 --- a/ruby-lokalise-api.gemspec +++ b/ruby-lokalise-api.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 1.6' spec.add_development_dependency 'rubocop-performance', '~> 1.5' spec.add_development_dependency 'rubocop-rake', '~> 0.6' - spec.add_development_dependency 'rubocop-rspec', '~> 2.0' + spec.add_development_dependency 'rubocop-rspec', '~> 3.0' spec.add_development_dependency 'simplecov', '~> 0.21' spec.add_development_dependency 'simplecov-lcov', '~> 0.8' spec.add_development_dependency 'webmock', '~> 3.14'