diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 14:55:20 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 15:08:43 -0700 |
commit | 21189d25a9385aa9ff3368716824b8333475a08b (patch) | |
tree | d4316d70ff88b5a43ffff90d04bd789da51cf9d4 /lib/chef/http | |
parent | fb6c052ae6d58db2499cf04ef0595d1e06a4c13c (diff) | |
download | chef-21189d25a9385aa9ff3368716824b8333475a08b.tar.gz |
fix Style/PreferredHashMethods
absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the
floor of that gem is bumped up.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/http')
-rw-r--r-- | lib/chef/http/cookie_manager.rb | 2 | ||||
-rw-r--r-- | lib/chef/http/json_input.rb | 2 | ||||
-rw-r--r-- | lib/chef/http/json_to_model_output.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/http/cookie_manager.rb b/lib/chef/http/cookie_manager.rb index 18824a8eff..723b26ad87 100644 --- a/lib/chef/http/cookie_manager.rb +++ b/lib/chef/http/cookie_manager.rb @@ -33,7 +33,7 @@ class Chef def handle_request(method, url, headers = {}, data = false) @host, @port = url.host, url.port - if @cookies.has_key?("#{@host}:#{@port}") + if @cookies.key?("#{@host}:#{@port}") headers["Cookie"] = @cookies["#{@host}:#{@port}"] end [method, url, headers, data] diff --git a/lib/chef/http/json_input.rb b/lib/chef/http/json_input.rb index 7cf2e4012f..e2c8b3e2ee 100644 --- a/lib/chef/http/json_input.rb +++ b/lib/chef/http/json_input.rb @@ -36,7 +36,7 @@ class Chef headers.delete_if { |key, _value| key.casecmp("content-type") == 0 } headers["Content-Type"] = "application/json" json_opts = {} - json_opts[:validate_utf8] = opts[:validate_utf8] if opts.has_key?(:validate_utf8) + json_opts[:validate_utf8] = opts[:validate_utf8] if opts.key?(:validate_utf8) data = Chef::JSONCompat.to_json(data, json_opts) # Force encoding to binary to fix SSL related EOFErrors # cf. http://tickets.opscode.com/browse/CHEF-2363 diff --git a/lib/chef/http/json_to_model_output.rb b/lib/chef/http/json_to_model_output.rb index 12ca1a90aa..997ceb8b1f 100644 --- a/lib/chef/http/json_to_model_output.rb +++ b/lib/chef/http/json_to_model_output.rb @@ -26,7 +26,7 @@ class Chef # a `json_class` key. class JSONToModelOutput < JSONOutput def initialize(opts = {}) - opts[:inflate_json_class] = true if !opts.has_key?(:inflate_json_class) + opts[:inflate_json_class] = true if !opts.key?(:inflate_json_class) super end end |