mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Clean up a few rubocop warnings.
This commit is contained in:
parent
7b512f23c5
commit
51cdf048ea
4 changed files with 21 additions and 11 deletions
|
@ -21,6 +21,14 @@ Lint/Eval:
|
|||
Exclude:
|
||||
- rest-client.windows.gemspec
|
||||
|
||||
Lint/HandleExceptions:
|
||||
Exclude:
|
||||
- lib/restclient/utils.rb
|
||||
|
||||
Lint/UselessAccessModifier:
|
||||
Exclude:
|
||||
- lib/restclient/windows/root_certs.rb
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
Style/Alias:
|
||||
|
@ -35,7 +43,7 @@ Style/AndOr:
|
|||
# TODO
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
Style/Blocks:
|
||||
Style/BlockDelimiters:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 48
|
||||
|
@ -90,6 +98,9 @@ Style/CollectionMethods:
|
|||
Style/ColonMethodCall:
|
||||
Enabled: false
|
||||
|
||||
Style/ConditionalAssignment:
|
||||
EnforcedStyle: assign_inside_condition
|
||||
|
||||
# Offense count: 2
|
||||
Style/ConstantName:
|
||||
Enabled: false
|
||||
|
@ -161,12 +172,11 @@ Style/FileName:
|
|||
Style/FormatString:
|
||||
Enabled: false
|
||||
|
||||
# TODO: configure
|
||||
# Offense count: 514
|
||||
# TODO: enable
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: SupportedStyles.
|
||||
Style/HashSyntax:
|
||||
EnforcedStyle: hash_rockets
|
||||
Enabled: false
|
||||
|
||||
# NOTABUG
|
||||
# Offense count: 8
|
||||
|
@ -337,10 +347,9 @@ Style/SpaceInsideParens:
|
|||
Style/StringLiterals:
|
||||
Enabled: false
|
||||
|
||||
# NOTABUG
|
||||
# Offense count: 14
|
||||
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
|
||||
Style/TrailingComma:
|
||||
Style/TrailingCommaInLiteral:
|
||||
EnforcedStyleForMultiline: comma
|
||||
Style/TrailingCommaInArguments:
|
||||
Enabled: false
|
||||
|
||||
# TODO: configure
|
||||
|
|
|
@ -96,6 +96,7 @@ module RestClient
|
|||
def self.proxy
|
||||
@proxy ||= nil
|
||||
end
|
||||
|
||||
def self.proxy=(value)
|
||||
@proxy = value
|
||||
@proxy_set = true
|
||||
|
|
|
@ -152,7 +152,7 @@ module RestClient
|
|||
#
|
||||
def self.beautify_headers(headers)
|
||||
headers.inject({}) do |out, (key, value)|
|
||||
key_sym = key.gsub(/-/, '_').downcase.to_sym
|
||||
key_sym = key.tr('-', '_').downcase.to_sym
|
||||
|
||||
# Handle Set-Cookie specially since it cannot be joined by comma.
|
||||
if key.downcase == 'set-cookie'
|
||||
|
|
|
@ -47,8 +47,6 @@ module RestClient
|
|||
result
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.fix_encoding(response)
|
||||
charset = RestClient::Utils.get_encoding_from_headers(response.headers)
|
||||
encoding = nil
|
||||
|
@ -68,6 +66,8 @@ module RestClient
|
|||
response
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def body_truncated(length)
|
||||
b = body
|
||||
if b.length > length
|
||||
|
|
Loading…
Reference in a new issue