FIX: possible sources of frozen strings exceptions

FIX: possible sources of frozen strings exceptions

diff --git a/lib/onebox/engine/github_commit_onebox.rb b/lib/onebox/engine/github_commit_onebox.rb
index f7b79a9..d598fd1 100644
--- a/lib/onebox/engine/github_commit_onebox.rb
+++ b/lib/onebox/engine/github_commit_onebox.rb
@@ -37,7 +37,7 @@ module Onebox
           message_words = message.gsub("\n\n", "\n").gsub("\n", "<br>").split(" ")
           max_words = 20
           result['message'] =  message_words[0..max_words].join(" ")
-          result['message'] << "..." if message_words.length > max_words
+          result['message'] += "..." if message_words.length > max_words
           result['message'] = result['message'].gsub("<br>", "\n")
         end
 
diff --git a/lib/onebox/engine/github_issue_onebox.rb b/lib/onebox/engine/github_issue_onebox.rb
index 3ecd3a4..0aaed86 100644
--- a/lib/onebox/engine/github_issue_onebox.rb
+++ b/lib/onebox/engine/github_issue_onebox.rb
@@ -29,7 +29,7 @@ module Onebox
         content_words = body_text.gsub("\n\n", "\n").gsub("\n", "<br>").split(" ") #one pass of removing double newline, then we change \n to <br> and later on we revert it back to \n this is a workaround to avoid losing newlines after we join it back.
         max_words = 20
         short_content =  content_words[0..max_words].join(" ")
-        short_content << "..." if content_words.length > max_words
+        short_content += "..." if content_words.length > max_words
 
         ulink = URI(link)
         {
diff --git a/lib/onebox/engine/typeform_onebox.rb b/lib/onebox/engine/typeform_onebox.rb
index b8cac0f..2b68ddd 100644
--- a/lib/onebox/engine/typeform_onebox.rb
+++ b/lib/onebox/engine/typeform_onebox.rb
@@ -31,12 +31,12 @@ module Onebox
         return escaped_src if query_params.has_key?('typeform-embed')
 
         if query_params.empty?
-          escaped_src << '?' unless escaped_src.end_with?('?')
+          escaped_src += '?' unless escaped_src.end_with?('?')
         else
-          escaped_src << '&'
+          escaped_src += '&'
         end
 
-        escaped_src << 'typeform-embed=embed-widget'
+        escaped_src += 'typeform-embed=embed-widget'
       end
     end
   end
diff --git a/lib/onebox/engine/wikipedia_onebox.rb b/lib/onebox/engine/wikipedia_onebox.rb
index a276a4c..d530478 100644
--- a/lib/onebox/engine/wikipedia_onebox.rb
+++ b/lib/onebox/engine/wikipedia_onebox.rb
@@ -53,7 +53,7 @@ module Onebox
           cnt = 0
           while text.length < Onebox::LayoutSupport.max_text && cnt <= 3
             break if cnt >= paras.size
-            text << " " unless cnt == 0
+            text += " " unless cnt == 0
 
             if paras[cnt].name == "ul" #Handle UL tag. Generate a textual ordered list (1.item | 2.item | 3.item). Unfourtently no newline allowed in output
               li_index = 1

GitHub sha: 3f82ec99

1 Like