Commit 022598c1 by Loren Segal

Check if class is defined instead of SDK version

parent e377e85f
...@@ -99,14 +99,14 @@ module Paperclip ...@@ -99,14 +99,14 @@ module Paperclip
raise e raise e
end unless defined?(AWS::Core) end unless defined?(AWS::Core)
# Overriding AWS::Core::LogFormatter to make sure it return a UTF-8 string # Overriding log formatter to make sure it return a UTF-8 string
if AWS::VERSION >= "1.3.9" if defined?(AWS::Core::LogFormatter)
AWS::Core::LogFormatter.class_eval do AWS::Core::LogFormatter.class_eval do
def summarize_hash(hash) def summarize_hash(hash)
hash.map { |key, value| ":#{key}=>#{summarize_value(value)}".force_encoding('UTF-8') }.sort.join(',') hash.map { |key, value| ":#{key}=>#{summarize_value(value)}".force_encoding('UTF-8') }.sort.join(',')
end end
end end
else elsif defined?(AWS::Core::ClientLogging)
AWS::Core::ClientLogging.class_eval do AWS::Core::ClientLogging.class_eval do
def sanitize_hash(hash) def sanitize_hash(hash)
hash.map { |key, value| "#{sanitize_value(key)}=>#{sanitize_value(value)}".force_encoding('UTF-8') }.sort.join(',') hash.map { |key, value| "#{sanitize_value(key)}=>#{sanitize_value(value)}".force_encoding('UTF-8') }.sort.join(',')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment