1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-06 02:55:50 +03:00
* Update rubopcop [WIP]

* Further rubocop fixes

* Fix rubocop-rails cops

* Fix spec

* Disable rubocop suggestions

* Run rubocop in github actions rather than in codeclimate
Этот коммит содержится в:
Max Melentiev
2023-12-30 15:20:27 +00:00
коммит произвёл GitHub
родитель 7bcb0caded
Коммит 57b17f068c
82 изменённых файлов: 303 добавлений и 134 удалений

Просмотреть файл

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Telegram
module Bot
# Telegram clients can perform requests in async way with
@@ -128,7 +130,7 @@ module Telegram
#
# If no block is given returns previously set value or the global one,
# set by #async=.
def async(val = true)
def async(val = true) # rubocop:disable Style/OptionalBooleanParameter
thread_key = object_id
thread_store = Async.thread_store
return thread_store.fetch(thread_key) { @async } unless block_given?
@@ -137,7 +139,7 @@ module Telegram
thread_store[thread_key] = self.class.prepare_async_val(val)
yield
ensure
if MISSING_VALUE == old_val
if old_val == MISSING_VALUE
thread_store.delete(thread_key)
else
thread_store[thread_key] = old_val