aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-28 17:38:11 -0500
committerJack Nagel2014-06-28 17:38:11 -0500
commit870bbdceae21c8feac4d99ef36169977e55cb4d0 (patch)
tree81c31a4c1d84aab62616063d0f0f0e375dc93c4d /Library
parentc15ad2625757140a05ede4b13029b60adaca03a0 (diff)
downloadhomebrew-870bbdceae21c8feac4d99ef36169977e55cb4d0.tar.bz2
gist-logs: 1.8 compat
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-gist-logs.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Contributions/cmd/brew-gist-logs.rb b/Library/Contributions/cmd/brew-gist-logs.rb
index d36567f3e..120818d49 100755
--- a/Library/Contributions/cmd/brew-gist-logs.rb
+++ b/Library/Contributions/cmd/brew-gist-logs.rb
@@ -77,7 +77,9 @@ def post path, data
response = http.request(request)
raise HTTP_Error, response if response.code != '201'
- if response["Content-Type"].downcase == "application/json; charset=utf-8"
+ if !response.body.respond_to?(:force_encoding)
+ body = response.body
+ elsif response["Content-Type"].downcase == "application/json; charset=utf-8"
body = response.body.dup.force_encoding(Encoding::UTF_8)
else
body = response.body.encode(Encoding::UTF_8, undef: :replace)