diff --git a/.rubocop.yml b/.rubocop.yml index 3364cd5..f4d1051 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,6 @@ +# Rubocop does not support 2.0 +Gemspec/RequiredRubyVersion: {Enabled: false} + Rails: {Enabled: true} Layout/AlignParameters: diff --git a/Gemfile b/Gemfile index db13674..2bc1ec0 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ group :development do gem 'rspec-its', '~> 1.1.0' gem 'rspec-rails', '~> 3.5.0' - gem 'rubocop', '~> 0.51.0' + gem 'rubocop', '~> 0.52.1' gem 'coveralls', '~> 0.8.2', require: false end diff --git a/lib/telegram/bot/client.rb b/lib/telegram/bot/client.rb index 83f31a9..b04032e 100644 --- a/lib/telegram/bot/client.rb +++ b/lib/telegram/bot/client.rb @@ -4,7 +4,7 @@ require 'httpclient' module Telegram module Bot class Client - URL_TEMPLATE = 'https://api.telegram.org/bot%s/'.freeze + URL_TEMPLATE = 'https://api.telegram.org/bot%s/'.freeze autoload :TypedResponse, 'telegram/bot/client/typed_response' extend Initializers @@ -44,7 +44,7 @@ module Telegram @client = HTTPClient.new @token = token || options[:token] @username = username || options[:username] - @base_uri = format URL_TEMPLATE, self.token + @base_uri = format(URL_TEMPLATE, token: self.token) end def request(action, body = {}) diff --git a/spec/telegram/bot/client_spec.rb b/spec/telegram/bot/client_spec.rb index 396fee6..b62c871 100644 --- a/spec/telegram/bot/client_spec.rb +++ b/spec/telegram/bot/client_spec.rb @@ -52,7 +52,7 @@ RSpec.describe Telegram::Bot::Client do describe '#request' do subject { -> { instance.request(action, request_body) } } let(:action) { :some_action } - let(:url) { "#{format described_class::URL_TEMPLATE, token}#{action}" } + let(:url) { "#{format(described_class::URL_TEMPLATE, token: token)}#{action}" } let(:request_body) { double(:body) } let(:prepared_body) { double(:prepared_body) } let(:response) { HTTP::Message.new_response(body).tap { |x| x.status = status } }