diff options
author | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-09-04 22:32:57 +0300 |
---|---|---|
committer | micael.bergeron <micael.bergeron@solutionstlm.com> | 2017-09-06 16:01:53 +0300 |
commit | dbaed90c8d3dffb2dd970f1621f551dd322db5ee (patch) | |
tree | 61f3a92dff29e8229a224da5e864f5504bf366ab /lib/gitlab/encoding_helper.rb | |
parent | 5625b0e4534de834235ce5dbeef89a5e976b698c (diff) |
fix refactoring error with Blob.binary?
remove some lint
Diffstat (limited to 'lib/gitlab/encoding_helper.rb')
-rw-r--r-- | lib/gitlab/encoding_helper.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/encoding_helper.rb b/lib/gitlab/encoding_helper.rb index 21a14141c87..8ac756a0b6a 100644 --- a/lib/gitlab/encoding_helper.rb +++ b/lib/gitlab/encoding_helper.rb @@ -14,7 +14,7 @@ module Gitlab ENCODING_CONFIDENCE_THRESHOLD = 50 # - # + # def encode!(message) return nil unless message.respond_to? :force_encoding @@ -33,12 +33,12 @@ module Gitlab # encode and clean the bad chars message.replace clean(message) - rescue => e + rescue encoding = detect ? detect[:encoding] : "unknown" "--broken encoding: #{encoding}" end - def all_binary?(data, detect=nil) + def all_binary?(data, detect = nil) detect ||= CharlockHolmes::EncodingDetector.detect(data) detect && detect[:type] == :binary end @@ -65,7 +65,7 @@ module Gitlab clean(message) end end - + private def clean(message) |