mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-29 00:03:58 -04:00
chore: rubocop lint Style/StructInheritance (#904)
This commit is contained in:
parent
c9fcbcc048
commit
c1febd329f
@ -424,14 +424,7 @@ Style/StringLiteralsInInterpolation:
|
||||
- 'lib/faraday/options/env.rb'
|
||||
- 'spec/faraday/utils_spec.rb'
|
||||
|
||||
# Offense count: 3
|
||||
Style/StructInheritance:
|
||||
Exclude:
|
||||
- 'lib/faraday/adapter/test.rb'
|
||||
- 'lib/faraday/request.rb'
|
||||
- 'spec/faraday/rack_builder_spec.rb'
|
||||
|
||||
# Offense count: 272
|
||||
# Offense count: 271
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Metrics/LineLength:
|
||||
|
@ -132,7 +132,10 @@ module Faraday
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop:disable Style/StructInheritance
|
||||
class Stub < Struct.new(:host, :path, :params, :headers, :body, :block)
|
||||
# rubocop:enable Style/StructInheritance
|
||||
|
||||
def initialize(host, full, headers, body, block)
|
||||
path, query = full.respond_to?(:split) ? full.split('?') : full
|
||||
params = query ?
|
||||
|
@ -24,7 +24,11 @@ module Faraday
|
||||
# @return [Hash] body
|
||||
# @!attribute options
|
||||
# @return [RequestOptions] options
|
||||
#
|
||||
# rubocop:disable Style/StructInheritance
|
||||
class Request < Struct.new(:method, :path, :params, :headers, :body, :options)
|
||||
# rubocop:enable Style/StructInheritance
|
||||
|
||||
extend MiddlewareRegistry
|
||||
|
||||
register_middleware File.expand_path('request', __dir__),
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
RSpec.describe Faraday::RackBuilder do
|
||||
# mock handler classes
|
||||
class Handler < Struct.new(:app)
|
||||
(Handler = Struct.new(:app)).class_eval do
|
||||
def call(env)
|
||||
env[:request_headers]['X-Middleware'] ||= ''
|
||||
env[:request_headers]['X-Middleware'] += ":#{self.class.name.split('::').last}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user