mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
Fixes Rubocop Style/SingleLineMethods.
This commit is contained in:
parent
a41b6ac8d9
commit
15303a3415
@ -294,20 +294,6 @@ Style/SafeNavigation:
|
||||
- 'lib/faraday/connection.rb'
|
||||
- 'lib/faraday/options/proxy_options.rb'
|
||||
|
||||
# Offense count: 9
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowIfMethodIsEmpty.
|
||||
Style/SingleLineMethods:
|
||||
Exclude:
|
||||
- 'lib/faraday/adapter.rb'
|
||||
- 'lib/faraday/adapter/em_http.rb'
|
||||
- 'lib/faraday/rack_builder.rb'
|
||||
- 'lib/faraday/utils.rb'
|
||||
- 'spec/support/fake_safe_buffer.rb'
|
||||
- 'test/adapters/em_http_test.rb'
|
||||
- 'test/adapters/em_synchrony_test.rb'
|
||||
- 'test/adapters/rack_test.rb'
|
||||
|
||||
# Offense count: 280
|
||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
|
@ -24,7 +24,9 @@ module Faraday
|
||||
# This module marks an Adapter as supporting parallel requests.
|
||||
module Parallelism
|
||||
attr_writer :supports_parallel
|
||||
def supports_parallel?() @supports_parallel end
|
||||
def supports_parallel?
|
||||
@supports_parallel
|
||||
end
|
||||
|
||||
def inherited(subclass)
|
||||
super
|
||||
|
@ -206,7 +206,9 @@ module Faraday
|
||||
end
|
||||
|
||||
# @return [Boolean]
|
||||
def running?() @running end
|
||||
def running?
|
||||
@running
|
||||
end
|
||||
|
||||
def add
|
||||
if running?
|
||||
|
@ -36,9 +36,13 @@ module Faraday
|
||||
@args, @block = args, block
|
||||
end
|
||||
|
||||
def klass() @@constants[@name] end
|
||||
def klass
|
||||
@@constants[@name]
|
||||
end
|
||||
|
||||
def inspect() @name end
|
||||
def inspect
|
||||
@name
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
if other.is_a? Handler
|
||||
|
@ -23,7 +23,9 @@ module Faraday
|
||||
end.tr(' ', '+')
|
||||
end
|
||||
|
||||
def unescape(str) CGI.unescape str.to_s end
|
||||
def unescape(str)
|
||||
CGI.unescape str.to_s
|
||||
end
|
||||
|
||||
DEFAULT_SEP = /[&;] */n
|
||||
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
# emulates ActiveSupport::SafeBuffer#gsub
|
||||
FakeSafeBuffer = Struct.new(:string) do
|
||||
def to_s; self end
|
||||
def to_s
|
||||
self
|
||||
end
|
||||
|
||||
def gsub(regex)
|
||||
string.gsub(regex) do
|
||||
|
@ -4,7 +4,9 @@ require File.expand_path('integration', __dir__)
|
||||
|
||||
module Adapters
|
||||
class EMHttpTest < Faraday::TestCase
|
||||
def adapter() :em_http end
|
||||
def adapter
|
||||
:em_http
|
||||
end
|
||||
|
||||
Integration.apply(self, :Parallel, :NonStreaming, :ParallelNonStreaming) do
|
||||
# https://github.com/eventmachine/eventmachine/pull/289
|
||||
|
@ -4,7 +4,9 @@ require File.expand_path('integration', __dir__)
|
||||
|
||||
module Adapters
|
||||
class EMSynchronyTest < Faraday::TestCase
|
||||
def adapter() :em_synchrony end
|
||||
def adapter
|
||||
:em_synchrony
|
||||
end
|
||||
|
||||
unless jruby?
|
||||
Integration.apply(self, :Parallel, :NonStreaming, :ParallelNonStreaming) do
|
||||
|
@ -5,7 +5,9 @@ require File.expand_path('../live_server', __dir__)
|
||||
|
||||
module Adapters
|
||||
class RackTest < Faraday::TestCase
|
||||
def adapter() :rack end
|
||||
def adapter
|
||||
:rack
|
||||
end
|
||||
|
||||
def adapter_options
|
||||
[Faraday::LiveServer]
|
||||
|
Loading…
x
Reference in New Issue
Block a user