Skip to content

Commit

Permalink
chore: RuboCop lint Layout/AlignHash (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMacTia authored and olleolleolle committed Feb 24, 2019
1 parent 671e9de commit ec709b3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 40 deletions.
15 changes: 0 additions & 15 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/AlignHash:
Exclude:
- 'lib/faraday/adapter/excon.rb'
- 'lib/faraday/adapter/httpclient.rb'
- 'lib/faraday/adapter/rack.rb'
- 'lib/faraday/autoload.rb'
- 'lib/faraday/request.rb'
- 'script/server'

# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
Expand Down
12 changes: 6 additions & 6 deletions lib/faraday/adapter/excon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def call(env)

if req[:proxy]
opts[:proxy] = {
:host => req[:proxy][:uri].host,
:host => req[:proxy][:uri].host,
:hostname => req[:proxy][:uri].hostname,
:port => req[:proxy][:uri].port,
:scheme => req[:proxy][:uri].scheme,
:user => req[:proxy][:user],
:port => req[:proxy][:uri].port,
:scheme => req[:proxy][:uri].scheme,
:user => req[:proxy][:user],
:password => req[:proxy][:password]
}
end
Expand All @@ -51,9 +51,9 @@ def call(env)
conn = create_connection(env, opts)

resp = conn.request \
:method => env[:method].to_s.upcase,
:method => env[:method].to_s.upcase,
:headers => env[:request_headers],
:body => read_body(env)
:body => read_body(env)

if req.stream_response?
warn "Streaming downloads for #{self.class.name} are not yet implemented."
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/adapter/httpclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def call(env)
env[:body] = env[:body].read if env[:body].respond_to? :read

resp = client.request env[:method], env[:url],
:body => env[:body],
:body => env[:body],
:header => env[:request_headers]

if (req = env[:request]).stream_response?
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/adapter/rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def call(env)
super
rack_env = {
:method => env[:method],
:input => env[:body].respond_to?(:read) ? env[:body].read : env[:body],
:input => env[:body].respond_to?(:read) ? env[:body].read : env[:body],
'rack.url_scheme' => env[:url].scheme
}

Expand Down
20 changes: 10 additions & 10 deletions lib/faraday/autoload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def all_loaded_constants
class Adapter
extend AutoloadHelper
autoload_all 'faraday/adapter',
:NetHttp => 'net_http',
:NetHttp => 'net_http',
:NetHttpPersistent => 'net_http_persistent',
:EMSynchrony => 'em_synchrony',
:EMHttp => 'em_http',
:Typhoeus => 'typhoeus',
:Patron => 'patron',
:Excon => 'excon',
:Test => 'test',
:Rack => 'rack',
:HTTPClient => 'httpclient'
:EMSynchrony => 'em_synchrony',
:EMHttp => 'em_http',
:Typhoeus => 'typhoeus',
:Patron => 'patron',
:Excon => 'excon',
:Test => 'test',
:Rack => 'rack',
:HTTPClient => 'httpclient'
end

class Request
Expand All @@ -81,6 +81,6 @@ class Response
extend AutoloadHelper
autoload_all 'faraday/response',
:RaiseError => 'raise_error',
:Logger => 'logger'
:Logger => 'logger'
end
end
8 changes: 4 additions & 4 deletions lib/faraday/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ def []=(key, value)
# @return [Hash] the hash ready to be serialized in Marshal.
def marshal_dump
{
:method => method,
:body => body,
:method => method,
:body => body,
:headers => headers,
:path => path,
:params => params,
:path => path,
:params => params,
:options => options
}
end
Expand Down
6 changes: 3 additions & 3 deletions script/server
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ if ENV['SSL_KEY']
require 'openssl'
require 'webrick/https'
webrick_opts.update \
:SSLEnable => true,
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(ENV['SSL_KEY'])),
:SSLCertificate => OpenSSL::X509::Certificate.new(File.read(ENV['SSL_FILE'])),
:SSLEnable => true,
:SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(ENV['SSL_KEY'])),
:SSLCertificate => OpenSSL::X509::Certificate.new(File.read(ENV['SSL_FILE'])),
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE
end

Expand Down

0 comments on commit ec709b3

Please sign in to comment.