зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-04 10:15:50 +03:00
Update rubopcop (#227)
* Update rubopcop [WIP] * Further rubocop fixes * Fix rubocop-rails cops * Fix spec * Disable rubocop suggestions * Run rubocop in github actions rather than in codeclimate
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7bcb0caded
Коммит
57b17f068c
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rack/session/abstract/id'
|
||||
require 'active_support/cache'
|
||||
|
||||
@@ -27,7 +29,8 @@ module Telegram
|
||||
protected
|
||||
|
||||
def session
|
||||
@_session ||= self.class.build_session(session_key)
|
||||
@_session ||= # rubocop:disable Naming/MemoizedInstanceVariableName
|
||||
self.class.build_session(session_key)
|
||||
end
|
||||
|
||||
def session_key
|
||||
@@ -41,7 +44,7 @@ module Telegram
|
||||
class SessionHash < Rack::Session::Abstract::SessionHash
|
||||
attr_reader :id
|
||||
|
||||
def initialize(store, id)
|
||||
def initialize(store, id) # rubocop:disable Lint/MissingSuper
|
||||
@store = store
|
||||
@id = id
|
||||
end
|
||||
@@ -65,13 +68,13 @@ module Telegram
|
||||
|
||||
def commit
|
||||
return unless loaded?
|
||||
data = to_hash.delete_if { |_, v| v.nil? }
|
||||
data = to_hash.compact
|
||||
@store.write(id, data)
|
||||
end
|
||||
end
|
||||
|
||||
class NullSessionHash < Session::SessionHash
|
||||
def initialize
|
||||
def initialize # rubocop:disable Lint/MissingSuper
|
||||
@data = {}
|
||||
@loaded = true
|
||||
@exists = true
|
||||
|
||||
Ссылка в новой задаче
Block a user