зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 09:46:17 +03:00
Update rubocop
Этот коммит содержится в:
@@ -1,3 +1,6 @@
|
||||
# Rubocop does not support 2.0
|
||||
Gemspec/RequiredRubyVersion: {Enabled: false}
|
||||
|
||||
Rails: {Enabled: true}
|
||||
|
||||
Layout/AlignParameters:
|
||||
|
||||
2
Gemfile
2
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
|
||||
|
||||
@@ -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%<token>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 = {})
|
||||
|
||||
@@ -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 } }
|
||||
|
||||
Ссылка в новой задаче
Block a user