diff --git a/script/import_scripts/answerbase.rb b/script/import_scripts/answerbase.rb index e011737fae1..1f436ac0ba3 100644 --- a/script/import_scripts/answerbase.rb +++ b/script/import_scripts/answerbase.rb @@ -255,7 +255,7 @@ class ImportScripts::Answerbase < ImportScripts::Base upload = @uploader.create_upload(user_id, path, filename) if upload.present? && upload.persisted? && !upload_ids.include?(upload.id) - raw << "\n" << @uploader.html_for_upload(upload, filename) + raw = "#{raw}\n#{@uploader.html_for_upload(upload, filename)}" end else STDERR.puts "Could not find file: #{path}" diff --git a/script/import_scripts/askbot.rb b/script/import_scripts/askbot.rb index b4cb4f26b3d..422c8fa3118 100644 --- a/script/import_scripts/askbot.rb +++ b/script/import_scripts/askbot.rb @@ -239,7 +239,7 @@ class ImportScripts::MyAskBot < ImportScripts::Base # ask.cvxr.com/question/(\d+)/[^'"}]* # I am sure this is incomplete, but we didn't make heavy use of internal # links on our site. - tmp = Regexp.quote("http://" << OLD_SITE) + tmp = Regexp.quote("http://#{OLD_SITE}") r1 = /"(#{tmp})?\/question\/(\d+)\/[a-zA-Z-]*\/?"/ r2 = /\((#{tmp})?\/question\/(\d+)\/[a-zA-Z-]*\/?\)/ r3 = /?/ diff --git a/script/import_scripts/base/csv_helper.rb b/script/import_scripts/base/csv_helper.rb index 3a175b935c3..7f7becbd3d6 100644 --- a/script/import_scripts/base/csv_helper.rb +++ b/script/import_scripts/base/csv_helper.rb @@ -24,7 +24,7 @@ module ImportScripts first = true row = nil - current_row = "" + current_row = +"" double_quote_count = 0 File.open(filename).each_line do |line| diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb index 8f36db0b4b7..9ca420f319a 100644 --- a/script/import_scripts/bespoke_1.rb +++ b/script/import_scripts/bespoke_1.rb @@ -67,7 +67,7 @@ class ImportScripts::Bespoke < ImportScripts::Base first = true row = nil - current_row = "" + current_row = +"" double_quote_count = 0 File.open(filename).each_line do |line| diff --git a/script/import_scripts/discuz_x.rb b/script/import_scripts/discuz_x.rb index 750a1ef6bf5..dc8f28ebfe3 100644 --- a/script/import_scripts/discuz_x.rb +++ b/script/import_scripts/discuz_x.rb @@ -787,7 +787,7 @@ class ImportScripts::DiscuzX < ImportScripts::Base FROM #{table_name 'forum_attachment'} WHERE pid = #{post.custom_fields['import_id']}" if !inline_attachments.empty? - sql << " AND aid NOT IN (#{inline_attachments.join(',')})" + sql = "#{sql} AND aid NOT IN (#{inline_attachments.join(',')})" end results = mysql_query(sql) diff --git a/script/import_scripts/jive.rb b/script/import_scripts/jive.rb index c70b3e07032..8d386a52c58 100644 --- a/script/import_scripts/jive.rb +++ b/script/import_scripts/jive.rb @@ -69,7 +69,7 @@ class ImportScripts::Jive < ImportScripts::Base first = true row = nil - current_row = "" + current_row = +"" double_quote_count = 0 File.open(filename).each_line do |line| diff --git a/script/import_scripts/jive_api.rb b/script/import_scripts/jive_api.rb index 62a892adcc3..cf6df4d5bef 100644 --- a/script/import_scripts/jive_api.rb +++ b/script/import_scripts/jive_api.rb @@ -129,7 +129,7 @@ class ImportScripts::JiveApi < ImportScripts::Base filters = "filter=entityDescriptor(#{entities.join(",")})" else path = "places/#{place["placeID"]}/contents" - filters = "filter=status(published)" + filters = +"filter=status(published)" if to_import[:filters] filters << "&filter=type(#{to_import[:filters][:type]})" if to_import[:filters][:type].present? filters << "&filter=creationDate(null,#{to_import[:filters][:created_after].strftime("%Y-%m-%dT%TZ")})" if to_import[:filters][:created_after].present? diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rb index e6f536f4ac6..83700a87ca4 100644 --- a/script/import_scripts/lithium.rb +++ b/script/import_scripts/lithium.rb @@ -1021,7 +1021,7 @@ SQL end def html_for_attachments(user_id, files) - html = "" + html = +"" files.each do |file| upload, filename = find_upload(user_id, file["attachment_id"], file["file_name"]) diff --git a/script/import_scripts/mbox/importer.rb b/script/import_scripts/mbox/importer.rb index 1be622250de..3d823e197df 100644 --- a/script/import_scripts/mbox/importer.rb +++ b/script/import_scripts/mbox/importer.rb @@ -137,7 +137,7 @@ module ImportScripts::Mbox body = receiver.add_attachments(body, user) end - body << Email::Receiver.elided_html(elided) if elided.present? + body = "#{body}#{Email::Receiver.elided_html(elided)}" if elided.present? body end diff --git a/script/import_scripts/mbox/support/indexer.rb b/script/import_scripts/mbox/support/indexer.rb index 4a24e9f8a4e..fa51ef62c42 100644 --- a/script/import_scripts/mbox/support/indexer.rb +++ b/script/import_scripts/mbox/support/indexer.rb @@ -155,7 +155,7 @@ module ImportScripts::Mbox end def each_mail(filename) - raw_message = '' + raw_message = +'' first_line_number = 1 last_line_number = 0 @@ -165,7 +165,7 @@ module ImportScripts::Mbox if line =~ @split_regex if last_line_number > 0 yield raw_message, first_line_number, last_line_number - raw_message = '' + raw_message = +'' first_line_number = last_line_number + 1 end else diff --git a/script/import_scripts/nabble.rb b/script/import_scripts/nabble.rb index e405486b3de..e877e9058d4 100644 --- a/script/import_scripts/nabble.rb +++ b/script/import_scripts/nabble.rb @@ -283,7 +283,7 @@ class String def indent(count, char = ' ') gsub(/([^\n]*)(\n|$)/) do |match| last_iteration = ($1 == "" && $2 == "") - line = "" + line = +"" line << (char * count) unless last_iteration line << $1 line << $2 diff --git a/script/import_scripts/phpbb3/database/database.rb b/script/import_scripts/phpbb3/database/database.rb index 70cc4e4a6fb..6b34febffc4 100644 --- a/script/import_scripts/phpbb3/database/database.rb +++ b/script/import_scripts/phpbb3/database/database.rb @@ -26,8 +26,10 @@ module ImportScripts::PhpBB3 require_relative 'database_3_1' Database_3_1.new(@database_client, @database_settings) else - raise UnsupportedVersionError, "Unsupported version (#{version}) of phpBB detected.\n" \ - << 'Currently only 3.0.x and 3.1.x are supported by this importer.' + raise UnsupportedVersionError, <<~MSG + Unsupported version (#{version}) of phpBB detected. + Currently only 3.0.x and 3.1.x are supported by this importer. + MSG end end diff --git a/script/import_scripts/phpbb3/importers/poll_importer.rb b/script/import_scripts/phpbb3/importers/poll_importer.rb index 023de32e709..82066bf3dea 100644 --- a/script/import_scripts/phpbb3/importers/poll_importer.rb +++ b/script/import_scripts/phpbb3/importers/poll_importer.rb @@ -56,7 +56,7 @@ module ImportScripts::PhpBB3 # @param poll_data [ImportScripts::PhpBB3::PollData] def get_poll_text(poll_data) title = @text_processor.process_raw_text(poll_data.title) - text = "#{title}\n\n" + text = +"#{title}\n\n" arguments = ["results=always"] arguments << "close=#{poll_data.close_time.iso8601}" if poll_data.close_time diff --git a/script/import_scripts/smf2.rb b/script/import_scripts/smf2.rb index e24c9ca6c25..1471d20d3b2 100644 --- a/script/import_scripts/smf2.rb +++ b/script/import_scripts/smf2.rb @@ -319,7 +319,7 @@ class ImportScripts::Smf2 < ImportScripts::Base "\n[#{tag}]#{$~[:inner].strip}[/#{tag}]\n" end body.gsub!(XListPattern) do |s| - r = "\n[ul]" + r = +"\n[ul]" s.lines.each { |l| r << '[li]' << l.strip.sub(/^\[x\]\s*/, '') << '[/li]' } r << "[/ul]\n" end @@ -357,7 +357,7 @@ class ImportScripts::Smf2 < ImportScripts::Base inner = $~[:inner].strip params = parse_tag_params($~[:params]) if params['author'].present? - quote = "[quote=\"#{params['author']}" + quote = +"[quote=\"#{params['author']}" if QuoteParamsPattern =~ params['link'] tl = topic_lookup_from_imported_post_id($~[:msg].to_i) quote << ", post:#{tl[:post_number]}, topic:#{tl[:topic_id]}" if tl