diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-09-08 23:35:38 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-09-08 23:35:38 -0700 |
commit | 607d247c9a4bcef57a905e82454d5cd10bea5e7e (patch) | |
tree | 0854bee0f5dbe75caad74f67b1778d602e9bfad9 /lib/mixlib/authentication | |
parent | 0fd5b792f8f7eaf38bb5308ff015e59513242c61 (diff) | |
download | mixlib-authentication-chefstyle.tar.gz |
Replace __FILE__ with __dir__ and use safe operatorschefstyle
A few new chefstyle rules to improve readability here.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/mixlib/authentication')
-rw-r--r-- | lib/mixlib/authentication/signedheaderauth.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb index c86c295..0e0d865 100644 --- a/lib/mixlib/authentication/signedheaderauth.rb +++ b/lib/mixlib/authentication/signedheaderauth.rb @@ -17,7 +17,7 @@ # limitations under the License. # -require "time" unless defined?(Time) +require "time" unless defined?(Time.zone_offset) require "base64" unless defined?(Base64) require "openssl/digest" require_relative "../authentication" @@ -196,7 +196,7 @@ module Mixlib # TODO: tim 2009-12-28: It'd be nice to just remove this special case, # always sign the entire request body, using the expanded multipart # body in the case of a file being include. - @hashed_body ||= if file && file.respond_to?(:read) + @hashed_body ||= if file&.respond_to?(:read) digester.hash_file(file, digest) else digester.hash_string(body, digest) |