mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
chore: Rubocop lint Style/SymbolArray
This commit is contained in:
parent
0af6142f47
commit
5d469d7ece
@ -1,6 +1,6 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config`
|
||||
# on 2019-02-28 17:19:19 +0000 using RuboCop version 0.65.0.
|
||||
# on 2019-02-28 17:29:46 +0000 using RuboCop version 0.65.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
@ -572,14 +572,7 @@ Style/StructInheritance:
|
||||
- 'lib/faraday/request.rb'
|
||||
- 'spec/faraday/rack_builder_spec.rb'
|
||||
|
||||
# Offense count: 6
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: MinSize.
|
||||
# SupportedStyles: percent, brackets
|
||||
Style/SymbolArray:
|
||||
EnforcedStyle: brackets
|
||||
|
||||
# Offense count: 272
|
||||
# Offense count: 271
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Metrics/LineLength:
|
||||
|
@ -10,7 +10,7 @@ module Faraday
|
||||
|
||||
def net_http_connection(env)
|
||||
@cached_connection ||=
|
||||
if Net::HTTP::Persistent.instance_method(:initialize).parameters.first == [:key, :name]
|
||||
if Net::HTTP::Persistent.instance_method(:initialize).parameters.first == %i[key name]
|
||||
options = { name: 'Faraday' }
|
||||
options[:pool_size] = @connection_options[:pool_size] if @connection_options.key?(:pool_size)
|
||||
Net::HTTP::Persistent.new(options)
|
||||
|
@ -14,7 +14,7 @@ module Faraday
|
||||
#
|
||||
class Connection
|
||||
# A Set of allowed HTTP verbs.
|
||||
METHODS = Set.new [:get, :post, :put, :delete, :head, :patch, :options, :trace, :connect]
|
||||
METHODS = Set.new %i[get post put delete head patch options trace connect]
|
||||
|
||||
# @return [Hash] URI query unencoded key/value pairs.
|
||||
attr_reader :params
|
||||
|
@ -23,7 +23,7 @@ module Faraday
|
||||
# interval that is random between 0.1 and 0.15.
|
||||
class Request::Retry < Faraday::Middleware
|
||||
DEFAULT_EXCEPTIONS = [Errno::ETIMEDOUT, 'Timeout::Error', Faraday::TimeoutError, Faraday::RetriableResponse].freeze
|
||||
IDEMPOTENT_METHODS = [:delete, :get, :head, :options, :put]
|
||||
IDEMPOTENT_METHODS = %i[delete get head options put]
|
||||
|
||||
class Options < Faraday::Options.new(:max, :interval, :max_interval, :interval_randomness,
|
||||
:backoff_factor, :exceptions, :methods, :retry_if, :retry_block,
|
||||
|
@ -9,7 +9,7 @@ module Faraday
|
||||
disable :logging
|
||||
disable :protection
|
||||
|
||||
[:get, :post, :put, :patch, :delete, :options].each do |method|
|
||||
%i[get post put patch delete options].each do |method|
|
||||
send(method, '/echo') do
|
||||
kind = request.request_method.downcase
|
||||
out = kind.dup
|
||||
@ -21,7 +21,7 @@ module Faraday
|
||||
end
|
||||
end
|
||||
|
||||
[:get, :post].each do |method|
|
||||
%i[get post].each do |method|
|
||||
send(method, '/stream') do
|
||||
content_type :txt
|
||||
stream do |out|
|
||||
@ -32,7 +32,7 @@ module Faraday
|
||||
end
|
||||
end
|
||||
|
||||
[:get, :post].each do |method|
|
||||
%i[get post].each do |method|
|
||||
send(method, '/empty_stream') do
|
||||
content_type :txt
|
||||
stream do |out|
|
||||
|
Loading…
x
Reference in New Issue
Block a user