diff options
author | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-14 14:08:03 +0000 |
commit | 51cfbdc4d16739caac4d946fadbe678444aafe34 (patch) | |
tree | 56dfd8f1cd9fd933de27268b32402e955a43ac2b /lib/chef/http.rb | |
parent | 05064423057d4cf46f4713b81b08829cf6d20af6 (diff) | |
download | chef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz |
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
Diffstat (limited to 'lib/chef/http.rb')
-rw-r--r-- | lib/chef/http.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb index a26e82f795..9f76b9de3a 100644 --- a/lib/chef/http.rb +++ b/lib/chef/http.rb @@ -21,14 +21,14 @@ # limitations under the License. # -require 'tempfile' -require 'net/https' -require 'uri' -require 'chef/http/basic_client' -require 'chef/monkey_patches/net_http' -require 'chef/config' -require 'chef/platform/query_helpers' -require 'chef/exceptions' +require "tempfile" +require "net/https" +require "uri" +require "chef/http/basic_client" +require "chef/monkey_patches/net_http" +require "chef/config" +require "chef/platform/query_helpers" +require "chef/exceptions" class Chef @@ -204,7 +204,7 @@ class Chef # when for most knife/chef-client work we never need/want this loaded. Thread.exclusive { unless defined?(SocketlessChefZeroClient) - require 'chef/http/socketless_chef_zero_client' + require "chef/http/socketless_chef_zero_client" end } SocketlessChefZeroClient.new(base_url) @@ -225,7 +225,7 @@ class Chef # The regular expressions used here are to make sure '@url' does not have # any trailing slashes and 'path' does not have any leading slashes. This # way they are always joined correctly using just one slash. - URI.parse(@url.gsub(%r{/+$}, '') + '/' + path.gsub(%r{^/+}, '')) + URI.parse(@url.gsub(%r{/+$}, "") + "/" + path.gsub(%r{^/+}, "")) end end @@ -381,12 +381,12 @@ class Chef return nil unless response.kind_of?(Net::HTTPRedirection) # Net::HTTPNotModified is undesired subclass of Net::HTTPRedirection so test for this return nil if response.kind_of?(Net::HTTPNotModified) - response['location'] + response["location"] end def build_headers(method, url, headers={}, json_body=false) headers = @default_headers.merge(headers) - headers['Content-Length'] = json_body.bytesize.to_s if json_body + headers["Content-Length"] = json_body.bytesize.to_s if json_body headers.merge!(Chef::Config[:custom_http_headers]) if Chef::Config[:custom_http_headers] headers end |