summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-09 07:53:56 -0800
commitf073747786abbe6ada55ed24b696a03e39c3c45d (patch)
tree7971d871e89d522a58291713761a6c83f68e8d19 /lib/chef/http
parentc6e69783705cfd48bfea0c943dc071964dd21311 (diff)
downloadchef-f073747786abbe6ada55ed24b696a03e39c3c45d.tar.gz
auto fixing some rubocops
Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/authenticator.rb4
-rw-r--r--lib/chef/http/http_request.rb2
-rw-r--r--lib/chef/http/ssl_policies.rb4
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/http/authenticator.rb b/lib/chef/http/authenticator.rb
index 970c19cd62..b5e28cf54d 100644
--- a/lib/chef/http/authenticator.rb
+++ b/lib/chef/http/authenticator.rb
@@ -73,9 +73,9 @@ class Chef
end
def load_signing_key(key_file, raw_key = nil)
- if (!!key_file)
+ if !!key_file
@raw_key = IO.read(key_file).strip
- elsif (!!raw_key)
+ elsif !!raw_key
@raw_key = raw_key.strip
else
return nil
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index a1ef9b9ee2..6cd7dda251 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -169,7 +169,7 @@ class Chef
raise ArgumentError, "You must provide :GET, :PUT, :POST, :DELETE or :HEAD as the method"
end
- @http_request.body = request_body if (request_body && @http_request.request_body_permitted?)
+ @http_request.body = request_body if request_body && @http_request.request_body_permitted?
# Optionally handle HTTP Basic Authentication
if url.user
user = URI.unescape(url.user)
diff --git a/lib/chef/http/ssl_policies.rb b/lib/chef/http/ssl_policies.rb
index f49fca02f6..51db01c232 100644
--- a/lib/chef/http/ssl_policies.rb
+++ b/lib/chef/http/ssl_policies.rb
@@ -86,8 +86,8 @@ class Chef
end
def set_client_credentials
- if (config[:ssl_client_cert] || config[:ssl_client_key])
- unless (config[:ssl_client_cert] && config[:ssl_client_key])
+ if config[:ssl_client_cert] || config[:ssl_client_key]
+ unless config[:ssl_client_cert] && config[:ssl_client_key]
raise Chef::Exceptions::ConfigurationError, "You must configure ssl_client_cert and ssl_client_key together"
end
unless ::File.exists?(config[:ssl_client_cert])