mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Appease rubocop for a few rules.
This commit is contained in:
parent
18ee352a95
commit
440b8256e5
3 changed files with 34 additions and 11 deletions
|
@ -17,6 +17,10 @@ Lint/StringConversionInInterpolation:
|
|||
Lint/UnusedBlockArgument:
|
||||
Enabled: false
|
||||
|
||||
Lint/Eval:
|
||||
Exclude:
|
||||
- rest-client.windows.gemspec
|
||||
|
||||
# Offense count: 4
|
||||
# Cop supports --auto-correct.
|
||||
Style/Alias:
|
||||
|
@ -49,6 +53,20 @@ Style/ClassAndModuleCamelCase:
|
|||
Style/ClassAndModuleChildren:
|
||||
Enabled: false
|
||||
|
||||
# TODO?
|
||||
# Offense count: 14
|
||||
Metrics/AbcSize:
|
||||
Max: 75
|
||||
|
||||
# TODO?
|
||||
Metrics/MethodLength:
|
||||
Max: 66
|
||||
|
||||
# TODO?
|
||||
# Offense count: 4
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 24
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
|
@ -105,6 +123,11 @@ Style/DoubleNegation:
|
|||
Style/EachWithObject:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 5
|
||||
# Cop supports --auto-correct.
|
||||
Style/EmptyLines:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 11
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||
|
|
|
@ -285,7 +285,7 @@ module RestClient
|
|||
# followed by two forward slashes. (The slashes are not part of the URI
|
||||
# RFC, but specified by the URL RFC 1738.)
|
||||
# https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
url = 'http://' + url unless url.match(/\A[a-z][a-z0-9+.-]*:\/\//i)
|
||||
url = 'http://' + url unless url.match(%r{\A[a-z][a-z0-9+.-]*://}i)
|
||||
URI.parse(url)
|
||||
end
|
||||
|
||||
|
@ -554,7 +554,7 @@ module RestClient
|
|||
def stringify_headers headers
|
||||
headers.inject({}) do |result, (key, value)|
|
||||
if key.is_a? Symbol
|
||||
key = key.to_s.split(/_/).map { |w| w.capitalize }.join('-')
|
||||
key = key.to_s.split(/_/).map(&:capitalize).join('-')
|
||||
end
|
||||
if 'CONTENT-TYPE' == key.upcase
|
||||
target_value = value.to_s
|
||||
|
|
Loading…
Add table
Reference in a new issue