mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-04-27 14:57:40 +00:00
AutoFix RuboCop Layout/EmptyLinesAroundClassBody
This commit is contained in:
parent
aa596b832c
commit
cf62a2439d
4 changed files with 0 additions and 15 deletions
|
|
@ -29,16 +29,6 @@ Gemspec/RequiredRubyVersion:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'grape_logging.gemspec'
|
- 'grape_logging.gemspec'
|
||||||
|
|
||||||
# Offense count: 5
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
# Configuration parameters: EnforcedStyle.
|
|
||||||
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
|
|
||||||
Layout/EmptyLinesAroundClassBody:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/grape_logging/formatters/rails.rb'
|
|
||||||
- 'lib/grape_logging/loggers/request_headers.rb'
|
|
||||||
- 'lib/grape_logging/middleware/request_logger.rb'
|
|
||||||
|
|
||||||
# Offense count: 2
|
# Offense count: 2
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
# This cop supports safe autocorrection (--autocorrect).
|
||||||
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
# Configuration parameters: EnforcedStyleAlignWith, Severity.
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ require 'rack/utils'
|
||||||
module GrapeLogging
|
module GrapeLogging
|
||||||
module Formatters
|
module Formatters
|
||||||
class Rails
|
class Rails
|
||||||
|
|
||||||
def call(severity, datetime, _, data)
|
def call(severity, datetime, _, data)
|
||||||
if data.is_a?(String)
|
if data.is_a?(String)
|
||||||
"#{severity[0..0]} [#{datetime}] #{severity} -- : #{data}\n"
|
"#{severity[0..0]} [#{datetime}] #{severity} -- : #{data}\n"
|
||||||
|
|
@ -53,7 +52,6 @@ module GrapeLogging
|
||||||
|
|
||||||
message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
module GrapeLogging
|
module GrapeLogging
|
||||||
module Loggers
|
module Loggers
|
||||||
class RequestHeaders < GrapeLogging::Loggers::Base
|
class RequestHeaders < GrapeLogging::Loggers::Base
|
||||||
|
|
||||||
HTTP_PREFIX = 'HTTP_'.freeze
|
HTTP_PREFIX = 'HTTP_'.freeze
|
||||||
|
|
||||||
def parameters(request, _)
|
def parameters(request, _)
|
||||||
|
|
@ -16,7 +15,6 @@ module GrapeLogging
|
||||||
|
|
||||||
{ headers: headers }
|
{ headers: headers }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ require 'grape'
|
||||||
module GrapeLogging
|
module GrapeLogging
|
||||||
module Middleware
|
module Middleware
|
||||||
class RequestLogger < Grape::Middleware::Base
|
class RequestLogger < Grape::Middleware::Base
|
||||||
|
|
||||||
ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
|
ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
|
||||||
event = ActiveSupport::Notifications::Event.new(*args)
|
event = ActiveSupport::Notifications::Event.new(*args)
|
||||||
GrapeLogging::Timings.append_db_runtime(event)
|
GrapeLogging::Timings.append_db_runtime(event)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue