diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index da7ecf92fdb..e31b08fbe9e 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -45,14 +45,14 @@ class PostsController < ApplicationController opts[:limit] = MARKDOWN_TOPIC_PAGE_SIZE topic_view = TopicView.new(params[:topic_id], current_user, opts) content = topic_view.posts.map do |p| - <<~HEREDOC + <<~MD #{p.user.username} | #{p.updated_at} | ##{p.post_number} #{p.raw} ------------------------- - HEREDOC + MD end render plain: content.join end diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index 277be0ef215..9a35400ab22 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -247,7 +247,7 @@ class SessionController < ApplicationController rescue ActiveRecord::RecordInvalid => e if SiteSetting.verbose_discourse_connect_logging - Rails.logger.warn(<<~EOF) + Rails.logger.warn(<<~TEXT) Verbose SSO log: Record was invalid: #{e.record.class.name} #{e.record.id} #{e.record.errors.to_h} @@ -256,7 +256,7 @@ class SessionController < ApplicationController SSO Diagnostics: #{sso.diagnostics} - EOF + TEXT end text = nil diff --git a/app/jobs/base.rb b/app/jobs/base.rb index 8d82e2d2dfc..381e5a93f8d 100644 --- a/app/jobs/base.rb +++ b/app/jobs/base.rb @@ -303,11 +303,11 @@ module Jobs # Simulate the args being dumped/parsed through JSON parsed_opts = JSON.parse(JSON.dump(opts)) if opts != parsed_opts - Discourse.deprecate(<<~MSG.squish, since: "2.9", drop_from: "3.0") + Discourse.deprecate(<<~TEXT.squish, since: "2.9", drop_from: "3.0") #{klass.name} was enqueued with argument values which do not cleanly serialize to/from JSON. This means that the job will be run with slightly different values than the ones supplied to `enqueue`. Argument values should be strings, booleans, numbers, or nil (or arrays/hashes of those value types). - MSG + TEXT end opts = parsed_opts diff --git a/app/serializers/reviewable_serializer.rb b/app/serializers/reviewable_serializer.rb index c1af40b2a2b..5dafa06a0b9 100644 --- a/app/serializers/reviewable_serializer.rb +++ b/app/serializers/reviewable_serializer.rb @@ -59,7 +59,7 @@ class ReviewableSerializer < ApplicationSerializer def self.create_attribute(name, field) attribute(name) - class_eval <<~GETTER + class_eval <<~RUBY def #{name} #{field} end @@ -67,7 +67,7 @@ class ReviewableSerializer < ApplicationSerializer def include_#{name}? #{name}.present? end - GETTER + RUBY end # This is easier than creating an AMS method for each attribute diff --git a/app/services/user_action_manager.rb b/app/services/user_action_manager.rb index fa80f040859..b3c169466a8 100644 --- a/app/services/user_action_manager.rb +++ b/app/services/user_action_manager.rb @@ -11,7 +11,7 @@ class UserActionManager end [:notification, :post, :topic, :post_action].each do |type| - self.class_eval(<<~METHODS) + self.class_eval(<<~RUBY) def self.#{type}_created(*args) return if @disabled #{type}_rows(*args).each { |row| UserAction.log_action!(row) } @@ -20,7 +20,7 @@ class UserActionManager return if @disabled #{type}_rows(*args).each { |row| UserAction.remove_action!(row) } end - METHODS + RUBY end private diff --git a/config/initializers/000-trace_pg_connections.rb b/config/initializers/000-trace_pg_connections.rb index ef4c4572e9c..ccfa7600080 100644 --- a/config/initializers/000-trace_pg_connections.rb +++ b/config/initializers/000-trace_pg_connections.rb @@ -39,7 +39,7 @@ if ENV["TRACE_PG_CONNECTIONS"] def log_access(&blk) @access_log_mutex.synchronize do if !@accessor_thread.nil? - Rails.logger.error <<~STRING + Rails.logger.error <<~TEXT PG Clash: A connection is being accessed from two locations #{@accessor_thread} was using the connection. Backtrace: @@ -49,7 +49,7 @@ if ENV["TRACE_PG_CONNECTIONS"] #{Thread.current} is now attempting to use the connection. Backtrace: #{Thread.current&.backtrace&.join("\n")} - STRING + TEXT if ENV["ON_PG_CLASH"] == "byebug" require "byebug" diff --git a/config/initializers/100-verify_config.rb b/config/initializers/100-verify_config.rb index 4d2d986cd15..c2e7c63e669 100644 --- a/config/initializers/100-verify_config.rb +++ b/config/initializers/100-verify_config.rb @@ -5,7 +5,7 @@ if defined?(Rails::Server) && Rails.env.production? # Only run these checks when starting up a production server if ['localhost', 'production.localhost'].include?(Discourse.current_hostname) - puts < - RAW + HTML end def article_html diff --git a/lib/plugin_initialization_guard.rb b/lib/plugin_initialization_guard.rb index 8b5935dc370..9f9676ef159 100644 --- a/lib/plugin_initialization_guard.rb +++ b/lib/plugin_initialization_guard.rb @@ -24,7 +24,7 @@ def plugin_initialization_guard(&block) end end.reverse.join("\n") - STDERR.puts <<~MESSAGE + STDERR.puts <<~TEXT #{stack_trace} ** INCOMPATIBLE PLUGIN ** @@ -33,9 +33,9 @@ def plugin_initialization_guard(&block) #{plugin_path} Please try removing this plugin and rebuilding again! - MESSAGE + TEXT else - STDERR.puts <<~MESSAGE + STDERR.puts <<~TEXT ** PLUGIN FAILURE ** You are unable to build Discourse due to this error during plugin @@ -44,7 +44,7 @@ def plugin_initialization_guard(&block) #{error} #{error.backtrace.join("\n")} - MESSAGE + TEXT end exit 1 end diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rb index e323f38f3c6..36de290b259 100644 --- a/lib/stylesheet/importer.rb +++ b/lib/stylesheet/importer.rb @@ -34,23 +34,23 @@ module Stylesheet contents = +"" if body_font.present? - contents << <<~EOF + contents << <<~CSS #{font_css(body_font)} :root { --font-family: #{body_font[:stack]}; } - EOF + CSS end if heading_font.present? - contents << <<~EOF + contents << <<~CSS #{font_css(heading_font)} :root { --heading-font-family: #{heading_font[:stack]}; } - EOF + CSS end contents @@ -70,14 +70,14 @@ module Stylesheet end contents << font_css(font) - contents << <<~EOF + contents << <<~CSS .body-font-#{font[:key].tr("_", "-")} { font-family: #{font[:stack]}; } .heading-font-#{font[:key].tr("_", "-")} h2 { font-family: #{font[:stack]}; } - EOF + CSS end contents @@ -184,11 +184,11 @@ module Stylesheet fields.map do |field| value = field.value if value.present? - contents << <<~COMMENT + contents << <<~SCSS // Theme: #{field.theme.name} // Target: #{field.target_name} #{field.name} // Last Edited: #{field.updated_at} - COMMENT + SCSS contents << value end @@ -216,13 +216,13 @@ module Stylesheet fonts_dir = UrlHelper.absolute("#{Discourse.base_path}/fonts") font[:variants].each do |variant| src = variant[:src] ? variant[:src] : "url(\"#{fonts_dir}/#{variant[:filename]}?v=#{DiscourseFonts::VERSION}\") format(\"#{variant[:format]}\")" - contents << <<~EOF + contents << <<~CSS @font-face { font-family: #{font[:name]}; src: #{src}; font-weight: #{variant[:weight]}; } - EOF + CSS end end diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 9a504ab46a6..3c580944bbb 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -15,10 +15,10 @@ task 'assets:precompile:before' do if EMBER_CLI && !(ENV["EMBER_CLI_COMPILE_DONE"] == "1") # Using exec to free up Rails app memory during ember build - exec <<~SCRIPT + exec <<~SH NODE_OPTIONS='--max-old-space-size=2048' yarn --cwd app/assets/javascripts/discourse run ember build -prod && \ EMBER_CLI_COMPILE_DONE=1 bin/rake assets:precompile - SCRIPT + SH end # Ensure we ALWAYS do a clean build @@ -124,9 +124,9 @@ def compress_node(from, to) source_map_url = "#{File.basename(to)}.map" base_source_map = assets_path + assets_additional_path - cmd = <<~EOS + cmd = <<~SH terser '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "base='#{base_source_map}',root='#{source_map_root}',url='#{source_map_url}',includeSources=true" - EOS + SH STDERR.puts cmd result = `#{cmd} 2>&1` diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rake index 13fa2bce164..0c31c645b14 100644 --- a/lib/tasks/emails.rake +++ b/lib/tasks/emails.rake @@ -65,7 +65,7 @@ task 'emails:test', [:email] => [:environment] do |_, args| smtp = Discourse::Application.config.action_mailer.smtp_settings if smtp[:address].match(/smtp\.gmail\.com/) - puts <<~STR + puts <<~TEXT #{smtp} ============================== WARNING ============================== @@ -75,7 +75,7 @@ task 'emails:test', [:email] => [:environment] do |_, args| https://meta.discourse.org/t/discourse-aws-ec2-g-suite-troubleshooting/62931?u=pfaffman ========================= CONTINUING TEST ============================ - STR + TEXT end puts "Testing sending to #{email} using #{smtp[:address]}:#{smtp[:port]}, username:#{smtp[:user_name]} with #{smtp[:authentication]} auth." @@ -93,21 +93,21 @@ task 'emails:test', [:email] => [:environment] do |_, args| rescue Exception => e if e.to_s.match(/execution expired/) - message = <<~STR + message = <<~TEXT ======================================== ERROR ======================================== Connection to port #{smtp[:port]} failed. ====================================== SOLUTION ======================================= The most likely problem is that your server has outgoing SMTP traffic blocked. If you are using a service like Mailgun or Sendgrid, try using port 2525. ======================================================================================= - STR + TEXT elsif e.to_s.match(/530.*STARTTLS/) # We can't run a preliminary test with STARTTLS, we'll just try sending the test email. message = "OK" elsif e.to_s.match(/535/) - message = <<~STR + message = <<~TEXT ======================================== ERROR ======================================== AUTHENTICATION FAILED @@ -117,10 +117,10 @@ task 'emails:test', [:email] => [:environment] do |_, args| The most likely problem is that your SMTP username and/or Password is incorrect. Check them and try again. ======================================================================================= - STR + TEXT elsif e.to_s.match(/Connection refused/) - message = <<~STR + message = <<~TEXT ======================================== ERROR ======================================== CONNECTION REFUSED @@ -132,10 +132,10 @@ task 'emails:test', [:email] => [:environment] do |_, args| Check the port and your networking configuration. ======================================================================================= - STR + TEXT elsif e.to_s.match(/service not known/) - message = <<~STR + message = <<~TEXT ======================================== ERROR ======================================== SMTP SERVER NOT FOUND @@ -145,10 +145,10 @@ task 'emails:test', [:email] => [:environment] do |_, args| The most likely problem is that the host name of your SMTP server is incorrect. Check it and try again. ======================================================================================= - STR + TEXT else - message = <<~STR + message = <<~TEXT ======================================== ERROR ======================================== UNEXPECTED ERROR @@ -160,7 +160,7 @@ task 'emails:test', [:email] => [:environment] do |_, args| Please report the exact error message above to https://meta.discourse.org/ (And a solution, if you find one!) ======================================================================================= - STR + TEXT end end if message == "OK" @@ -174,13 +174,13 @@ task 'emails:test', [:email] => [:environment] do |_, args| email_log = Email::Sender.new(TestMailer.send_test(email), :test_message).send case email_log when SkippedEmailLog - puts <<~STR + puts <<~TEXT Mail was not sent. Reason: #{email_log.reason} - STR + TEXT when EmailLog - puts <<~STR + puts <<~TEXT Mail accepted by SMTP server. Message-ID: #{email_log.message_id} @@ -190,20 +190,20 @@ task 'emails:test', [:email] => [:environment] do |_, args| If the message is not delivered it is not a problem with Discourse. Check the SMTP server logs for the above Message ID to see why it failed to deliver the message. - STR + TEXT when nil - puts <<~STR + puts <<~TEXT Mail was not sent. Verify the status of the `disable_emails` site setting. - STR + TEXT else - puts <<~STR + puts <<~TEXT SCRIPT BUG: Got back a #{email_log.class} #{email_log.inspect} Mail may or may not have been sent. Check the destination mailbox. - STR + TEXT end rescue => error puts "Sending mail failed." @@ -211,11 +211,11 @@ task 'emails:test', [:email] => [:environment] do |_, args| end if SiteSetting.disable_emails != 'no' - puts <<~STR + puts <<~TEXT ### WARNING The `disable_emails` site setting is currently set to #{SiteSetting.disable_emails}. Consider changing it to 'no' before performing any further troubleshooting. - STR + TEXT end end diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake index 4a5d5cd6fb2..4af192ad647 100644 --- a/lib/tasks/javascript.rake +++ b/lib/tasks/javascript.rake @@ -22,7 +22,7 @@ def html_for_section(group) " {{replace-emoji \":#{icon['name']}:\" (hash lazy=true#{class_attr})}}" end - <<~SECTION + <<~HTML
{{i18n "emoji_picker.#{group["name"]}"}} @@ -31,14 +31,14 @@ def html_for_section(group) #{icons.join("\n").strip}
- SECTION + HTML end def write_template(path, task_name, template) - header = <<~HEADER + header = <<~JS // DO NOT EDIT THIS FILE!!! // Update it by running `rake javascript:#{task_name}` - HEADER + JS basename = File.basename(path) output_path = "#{Rails.root}/app/assets/javascripts/#{path}" @@ -50,10 +50,10 @@ def write_template(path, task_name, template) end def write_hbs_template(path, task_name, template) - header = <<~HEADER + header = <<~HBS {{!-- DO NOT EDIT THIS FILE!!! --}} {{!-- Update it by running `rake javascript:#{task_name}` --}} - HEADER + HBS basename = File.basename(path) output_path = "#{Rails.root}/app/assets/javascripts/#{path}" @@ -244,11 +244,11 @@ task 'javascript:update_constants' => :environment do groups_json = JSON.parse(File.read("lib/emoji/groups.json")) emoji_buttons = groups_json.map do |group| - <<~BUTTON + <<~HTML - BUTTON + HTML end emoji_sections = groups_json.map { |group| html_for_section(group) } diff --git a/lib/tasks/populate.thor b/lib/tasks/populate.thor index 50087729f86..52ad939eb47 100644 --- a/lib/tasks/populate.thor +++ b/lib/tasks/populate.thor @@ -3,7 +3,7 @@ # Generates posts and topics class Populate < Thor desc "posts", "Generate posts" - long_desc <<-LONGDESC + long_desc <<-MD Create topics with any number of posts, or add posts to an existing topic. Examples: @@ -20,7 +20,7 @@ class Populate < Thor > $ thor populate:posts -p 10 -n 5 - LONGDESC + MD method_option :num_posts, aliases: '-n', type: :numeric, required: true, desc: "Number of posts to make" method_option :users, aliases: '-u', type: :array, desc: "Usernames of users who will make the posts" method_option :title, aliases: '-t', desc: "The title of the topic, if making a new topic" diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index 387b9d18a43..83336f0a469 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -118,7 +118,7 @@ task "themes:qunit", :type, :value do |t, args| type = args[:type] value = args[:value] if !%w(name url id).include?(type) || value.blank? - raise <<~MSG + raise <<~TEXT Wrong arguments type:#{type.inspect}, value:#{value.inspect}" Usage: `bundle exec rake "themes:qunit[url,]"` @@ -126,7 +126,7 @@ task "themes:qunit", :type, :value do |t, args| `bundle exec rake "themes:qunit[name,]"` OR `bundle exec rake "themes:qunit[id,]"` - MSG + TEXT end ENV["THEME_#{type.upcase}"] = value.to_s ENV["QUNIT_RAILS_ENV"] ||= 'development' # qunit:test will switch to `test` by default diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake index 00079e05930..e3428629c08 100644 --- a/lib/tasks/uploads.rake +++ b/lib/tasks/uploads.rake @@ -165,11 +165,11 @@ def clean_up_uploads exit 1 end - puts <<~OUTPUT + puts <<~TEXT This task will remove upload records and files permanently. Would you like to take a full backup before the clean up? (Y/N) - OUTPUT + TEXT if STDIN.gets.chomp.downcase == 'y' puts "Starting backup..." @@ -420,7 +420,7 @@ task "uploads:analyze", [:cache_path, :limit] => :environment do |_, args| uploads_count = Upload.count optimized_images_count = OptimizedImage.count - puts <<~REPORT + puts <<~TEXT Report for '#{current_db}' -----------#{'-' * current_db.length} Number of `Upload` records in DB: #{uploads_count} @@ -430,7 +430,7 @@ task "uploads:analyze", [:cache_path, :limit] => :environment do |_, args| Number of images in uploads folder: #{paths_count} ------------------------------------#{'-' * paths_count.to_s.length} - REPORT + TEXT helper = Class.new do include ActionView::Helpers::NumberHelper diff --git a/plugins/discourse-details/spec/components/pretty_text_spec.rb b/plugins/discourse-details/spec/components/pretty_text_spec.rb index c208b762913..7c74a53c281 100644 --- a/plugins/discourse-details/spec/components/pretty_text_spec.rb +++ b/plugins/discourse-details/spec/components/pretty_text_spec.rb @@ -28,13 +28,13 @@ describe PrettyText do end it 'can replace spoilers in emails' do - md = PrettyText.cook(<<~EOF) + md = PrettyText.cook(<<~MD) hello [details="Summary"] world [/details] - EOF + MD md = PrettyText.format_for_email(md, post) html = "

hello

\n\nSummary (click for more details)" @@ -42,7 +42,7 @@ describe PrettyText do end it 'properly handles multiple spoiler blocks in a post' do - md = PrettyText.cook(<<~EOF) + md = PrettyText.cook(<<~MD) [details="First"] body secret stuff very long [/details] @@ -55,7 +55,7 @@ describe PrettyText do [details="Third"] body secret stuff very long [/details] - EOF + MD md = PrettyText.format_for_email(md, post) expect(md).not_to include('secret stuff') @@ -65,12 +65,12 @@ describe PrettyText do end it 'escapes summary text' do - md = PrettyText.cook(<<~EOF) + md = PrettyText.cook(<<~MD) [details=""] [/details] - EOF + MD md = PrettyText.format_for_email(md, post) expect(md).not_to include(' - SCRIPT + HTML theme.set_field(target: :desktop, name: "header", value: "") theme.save! diff --git a/spec/lib/email/authentication_results_spec.rb b/spec/lib/email/authentication_results_spec.rb index 02ef205d2c2..2b4c2b3b844 100644 --- a/spec/lib/email/authentication_results_spec.rb +++ b/spec/lib/email/authentication_results_spec.rb @@ -14,10 +14,10 @@ describe Email::AuthenticationResults do it "parses 'Service Provided, Authentication Done' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.3 - results = described_class.new(<<~EOF + results = described_class.new(<<~RAW example.com; spf=pass smtp.mailfrom=example.net - EOF + RAW ).results expect(results[0][:authserv_id]).to eq "example.com" expect(results[0][:resinfo][0][:method]).to eq "spf" @@ -30,15 +30,15 @@ describe Email::AuthenticationResults do it "parses 'Service Provided, Several Authentications Done, Single MTA' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.4 - results = described_class.new([<<~EOF , + results = described_class.new([<<~RAW , example.com; auth=pass (cram-md5) smtp.auth=sender@example.net; spf=pass smtp.mailfrom=example.net - EOF - <<~EOF , + RAW + <<~RAW , example.com; iprev=pass policy.iprev=192.0.2.200 - EOF + RAW ]).results expect(results[0][:authserv_id]).to eq "example.com" expect(results[0][:resinfo][0][:method]).to eq "auth" @@ -64,15 +64,15 @@ describe Email::AuthenticationResults do it "parses 'Service Provided, Several Authentications Done, Different MTAs' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.5 - results = described_class.new([<<~EOF , + results = described_class.new([<<~RAW , example.com; dkim=pass (good signature) header.d=example.com - EOF - <<~EOF , + RAW + <<~RAW , example.com; auth=pass (cram-md5) smtp.auth=sender@example.com; spf=fail smtp.mailfrom=example.com - EOF + RAW ]).results expect(results[0][:authserv_id]).to eq "example.com" @@ -99,17 +99,17 @@ describe Email::AuthenticationResults do it "parses 'Service Provided, Multi-tiered Authentication Done' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.6 - results = described_class.new([<<~EOF , + results = described_class.new([<<~RAW , example.com; dkim=pass reason="good signature" header.i=@mail-router.example.net; dkim=fail reason="bad signature" header.i=@newyork.example.com - EOF - <<~EOF , + RAW + <<~RAW , example.net; dkim=pass (good signature) header.i=@newyork.example.com - EOF + RAW ]).results expect(results[0][:authserv_id]).to eq "example.com" @@ -136,12 +136,12 @@ describe Email::AuthenticationResults do it "parses 'Comment-Heavy Example' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.7 - results = described_class.new(<<~EOF + results = described_class.new(<<~RAW foo.example.net (foobar) 1 (baz); dkim (Because I like it) / 1 (One yay) = (wait for it) fail policy (A dot can go here) . (like that) expired (this surprised me) = (as I wasn't expecting it) 1362471462 - EOF + RAW ).results expect(results[0][:authserv_id]).to eq "foo.example.net" @@ -163,12 +163,12 @@ describe Email::AuthenticationResults do end it "parses header with multiple props correctly" do - results = described_class.new(<<~EOF + results = described_class.new(<<~RAW mx.google.com; dkim=pass header.i=@email.example.com header.s=20111006 header.b=URn9MW+F; spf=pass (google.com: domain of foo@b.email.example.com designates 1.2.3.4 as permitted sender) smtp.mailfrom=foo@b.email.example.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=email.example.com - EOF + RAW ).results expect(results[0][:authserv_id]).to eq "mx.google.com" diff --git a/spec/lib/email/receiver_spec.rb b/spec/lib/email/receiver_spec.rb index 10112f4ed35..c152e173254 100644 --- a/spec/lib/email/receiver_spec.rb +++ b/spec/lib/email/receiver_spec.rb @@ -808,7 +808,7 @@ describe Email::Receiver do post = Post.last expect(post.user.email).to eq("ba@bar.com") - expect(post.raw).to eq(<<~EOF.chomp + expect(post.raw).to eq(<<~RAW.chomp) @team, can you have a look at this email below? [quote] @@ -823,8 +823,7 @@ describe Email::Receiver do XoXo [/quote] - EOF - ) + RAW end end @@ -976,7 +975,7 @@ describe Email::Receiver do let!(:post) { Fabricate(:post, topic: topic) } def process_mail_with_message_id(message_id) - mail_string = <<~REPLY + mail_string = <<~EMAIL Return-Path: From: Two To: one@foo.com @@ -989,7 +988,7 @@ describe Email::Receiver do Content-Transfer-Encoding: 7bit This is email reply testing with Message-ID formats. - REPLY + EMAIL Email::Receiver.new(mail_string).process! end @@ -1867,7 +1866,7 @@ describe Email::Receiver do context "#select_body" do let(:email) { - <<~EOF + <<~EMAIL MIME-Version: 1.0 Date: Tue, 01 Jan 2019 00:00:00 +0300 Subject: An email with whitespaces @@ -1916,11 +1915,11 @@ describe Email::Receiver do This is going to be stripped too. Bye! - EOF + EMAIL } let(:stripped_text) { - <<~EOF + <<~MD This is a line that will be stripped This is another line that will be stripped @@ -1962,7 +1961,7 @@ describe Email::Receiver do This is going to be stripped too. Bye! - EOF + MD } it "strips lines if strip_incoming_email_lines is enabled" do @@ -1976,7 +1975,7 @@ describe Email::Receiver do it "works with empty mail body" do SiteSetting.strip_incoming_email_lines = true - email = <<~EOF + email = <<~EMAIL Date: Tue, 01 Jan 2019 00:00:00 +0300 Subject: An email with whitespaces From: Foo @@ -1986,7 +1985,7 @@ describe Email::Receiver do -- my signature - EOF + EMAIL receiver = Email::Receiver.new(email) text, _elided, _format = receiver.select_body @@ -2004,7 +2003,7 @@ describe Email::Receiver do message_id: digest_message_id )} let(:email) { - <<~EOF + <<~EMAIL MIME-Version: 1.0 Date: Tue, 01 Jan 2019 00:00:00 +0300 From: someone <#{user.email}> @@ -2017,7 +2016,7 @@ describe Email::Receiver do hello there! I like the digest! - EOF + EMAIL } before do @@ -2034,7 +2033,7 @@ describe Email::Receiver do let(:user) { Fabricate(:user) } let(:group) { Fabricate(:group, users: [user]) } - let (:email_1) { <<~EOF + let (:email_1) { <<~EMAIL MIME-Version: 1.0 Date: Wed, 01 Jan 2019 12:00:00 +0200 Message-ID: <7aN1uwcokt2xkfG3iYrpKmiuVhy4w9b5@mail.gmail.com> @@ -2052,7 +2051,7 @@ describe Email::Receiver do Vivamus semper lacinia scelerisque. Cras urna magna, porttitor nec libero quis, congue viverra sapien. Nulla sodales ac tellus a suscipit. - EOF + EMAIL } let (:post_2) { @@ -2064,7 +2063,7 @@ describe Email::Receiver do ) } - let (:email_3) { <<~EOF + let (:email_3) { <<~EMAIL MIME-Version: 1.0 Date: Wed, 01 Jan 2019 12:00:00 +0200 References: <7aN1uwcokt2xkfG3iYrpKmiuVhy4w9b5@mail.gmail.com> @@ -2087,7 +2086,7 @@ describe Email::Receiver do felis. Sed pellentesque, massa auctor venenatis gravida, risus lorem iaculis mi, at hendrerit nisi turpis sit amet metus. Nulla egestas ante eget nisi luctus consectetur. - EOF + EMAIL } def receive(email_string) diff --git a/spec/lib/email_cook_spec.rb b/spec/lib/email_cook_spec.rb index d47f5b91f80..f120233ce5c 100644 --- a/spec/lib/email_cook_spec.rb +++ b/spec/lib/email_cook_spec.rb @@ -16,28 +16,28 @@ describe EmailCook do end it "doesn't add linebreaks to long lines" do - long = plaintext(<<~LONG_EMAIL) + long = plaintext(<<~EMAIL) Hello, Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc convallis volutpat risus. Nulla ac faucibus quam, quis cursus lorem. Sed rutrum eget nunc sed accumsan. Vestibulum feugiat mi vitae turpis tempor dignissim. - LONG_EMAIL + EMAIL - long_cooked = (+<<~LONG_COOKED).strip! + long_cooked = (+<<~HTML).strip! Hello,

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc convallis volutpat risus. Nulla ac faucibus quam, quis cursus lorem. Sed rutrum eget nunc sed accumsan. Vestibulum feugiat mi vitae turpis tempor dignissim.
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end it "replaces a blank line with 2 linebreaks" do - long = plaintext(<<~LONG_EMAIL) + long = plaintext(<<~EMAIL) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc convallis volutpat risus. Nulla ac faucibus quam, quis cursus lorem. Sed rutrum eget nunc sed accumsan. @@ -45,9 +45,9 @@ describe EmailCook do Vestibulum feugiat mi vitae turpis tempor dignissim. Stet clita kasd gubergren. - LONG_EMAIL + EMAIL - long_cooked = (+<<~LONG_COOKED).strip! + long_cooked = (+<<~HTML).strip! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc convallis volutpat risus.
Nulla ac faucibus quam, quis cursus lorem. Sed rutrum eget nunc sed accumsan. @@ -56,13 +56,13 @@ describe EmailCook do

Stet clita kasd gubergren.
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end it "escapes HTML" do - long = plaintext(<<~LONG_EMAIL) + long = plaintext(<<~EMAIL) Lorem ipsum dolor sit amet, consectetur adipiscing elit.
@@ -70,9 +70,9 @@ describe EmailCook do
Nunc convallis volutpat risus. - LONG_EMAIL + EMAIL - long_cooked = (+<<~LONG_COOKED).strip! + long_cooked = (+<<~HTML).strip! Lorem ipsum dolor sit amet, consectetur adipiscing elit.

<form name="f1" method="post" action="test.html" onsubmit="javascript:showAlert()"> @@ -81,29 +81,29 @@ describe EmailCook do

Nunc convallis volutpat risus.
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end it "replaces indentation of more than 2 spaces with corresponding amount of non-breaking spaces" do nbsp = "\u00A0" - long = plaintext(<<~LONG_EMAIL) + long = plaintext(<<~EMAIL) Lorem ipsum dolor sit amet, consectetur adipiscing elit. this is intended by 4 spaces this is intended by 1 space no indentation, but lots of spaces - LONG_EMAIL + EMAIL - long_cooked = (+<<~LONG_COOKED).strip! + long_cooked = (+<<~HTML).strip! Lorem ipsum dolor sit amet, consectetur adipiscing elit.

#{nbsp}#{nbsp}#{nbsp}#{nbsp}this is intended by 4 spaces
this is intended by 1 space
no indentation, but lots of spaces
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end @@ -129,7 +129,7 @@ describe EmailCook do end it "it works and does not interpret Markdown in plaintext and elided" do - long = <<~LONG_EMAIL + long = <<~EMAIL [plaintext] *Lorem ipsum* dolor sit amet, consectetur adipiscing elit. [/plaintext] @@ -139,9 +139,9 @@ describe EmailCook do [elided] At vero eos *et accusam* et justo duo dolores et ea rebum. [/elided] - LONG_EMAIL + EMAIL - long_cooked = <<~LONG_COOKED + long_cooked = <<~HTML *Lorem ipsum* dolor sit amet, consectetur adipiscing elit.



@@ -152,22 +152,22 @@ describe EmailCook do At vero eos *et accusam* et justo duo dolores et ea rebum.
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end it "works without attachments" do - long = <<~LONG_EMAIL + long = <<~EMAIL [plaintext] *Lorem ipsum* dolor sit amet, consectetur adipiscing elit. [/plaintext] [elided] At vero eos *et accusam* et justo duo dolores et ea rebum. [/elided] - LONG_EMAIL + EMAIL - long_cooked = <<~LONG_COOKED + long_cooked = <<~HTML *Lorem ipsum* dolor sit amet, consectetur adipiscing elit.


@@ -177,7 +177,7 @@ describe EmailCook do At vero eos *et accusam* et justo duo dolores et ea rebum.
- LONG_COOKED + HTML expect(cook(long)).to eq(long_cooked) end diff --git a/spec/lib/pretty_text_spec.rb b/spec/lib/pretty_text_spec.rb index 8b213fb0c49..b5b884051b4 100644 --- a/spec/lib/pretty_text_spec.rb +++ b/spec/lib/pretty_text_spec.rb @@ -353,7 +353,7 @@ describe PrettyText do expect(PrettyText.cook("[quote]\ntest")).not_to include('aside') expect(PrettyText.cook("[quote]\ntest\n[/quote]z")).not_to include('aside') - nested = <<~QUOTE + nested = <<~MD [quote] a [quote] @@ -361,7 +361,7 @@ describe PrettyText do [/quote] c [/quote] - QUOTE + MD cooked = PrettyText.cook(nested) expect(cooked.scan('aside').length).to eq(4) @@ -799,9 +799,9 @@ describe PrettyText do context "emojis" do it "should remove broken emoji" do - html = <<~EOS + html = <<~HTML \":bike:\" \":cat:\" \":discourse:\" - EOS + HTML expect(PrettyText.excerpt(html, 7)).to eq(":bike: …") expect(PrettyText.excerpt(html, 8)).to eq(":bike: …") expect(PrettyText.excerpt(html, 9)).to eq(":bike: …") @@ -914,7 +914,7 @@ describe PrettyText do end it "should not extract links inside oneboxes" do - onebox = <<~EOF + onebox = <<~HTML - EOF + HTML expect(PrettyText.extract_links(onebox).map(&:url)).to contain_exactly("https://twitter.com/EDBPostgres/status/1402528437441634306") end @@ -938,12 +938,13 @@ describe PrettyText do end it "handles custom bbcode excerpt" do - raw = <<~RAW + raw = <<~MD [excerpt] hello [site](https://site.com) [/excerpt] more stuff - RAW + MD + post = Fabricate(:post, raw: raw) expect(post.excerpt).to eq("hello site") end @@ -1929,17 +1930,17 @@ HTML it "can properly allowlist iframes" do SiteSetting.allowed_iframes = "https://bob.com/a|http://silly.com?EMBED=" - raw = <<~IFRAMES + raw = <<~HTML - IFRAMES + HTML # we require explicit HTTPS here - html = <<~IFRAMES + html = <<~HTML - IFRAMES + HTML cooked = PrettyText.cook(raw).strip diff --git a/spec/lib/search_spec copy.rb b/spec/lib/search_spec copy.rb index cff820c6025..c0b7d5efb06 100644 --- a/spec/lib/search_spec copy.rb +++ b/spec/lib/search_spec copy.rb @@ -551,9 +551,9 @@ describe Search do result = Search.execute('search term') - expect(result.posts.first.topic_title_headline).to eq(<<~TITLE.chomp) + expect(result.posts.first.topic_title_headline).to eq(<<~HTML.chomp) Very very very very very very very long topic title with our search term in the middle of the title - TITLE + HTML end it "limits the search headline to #{Search::GroupedSearchResults::BLURB_LENGTH} characters" do diff --git a/spec/lib/version_spec.rb b/spec/lib/version_spec.rb index c9012037031..284a6e64e77 100644 --- a/spec/lib/version_spec.rb +++ b/spec/lib/version_spec.rb @@ -76,25 +76,25 @@ describe Discourse::VERSION do end context "with a regular compatible list" do - let(:version_list) { <<~VERSION_LIST + let(:version_list) { <<~YML 2.5.0.beta6: twofivebetasix 2.5.0.beta4: twofivebetafour 2.5.0.beta2: twofivebetatwo 2.4.4.beta6: twofourfourbetasix 2.4.2.beta1: twofourtwobetaone - VERSION_LIST + YML } include_examples "test compatible resource" end context "handle a compatible resource out of order" do - let(:version_list) { <<~VERSION_LIST + let(:version_list) { <<~YML 2.4.2.beta1: twofourtwobetaone 2.5.0.beta4: twofivebetafour 2.5.0.beta6: twofivebetasix 2.5.0.beta2: twofivebetatwo 2.4.4.beta6: twofourfourbetasix - VERSION_LIST + YML } include_examples "test compatible resource" end diff --git a/spec/mailers/group_smtp_mailer_spec.rb b/spec/mailers/group_smtp_mailer_spec.rb index afca00f11e5..e8e2dcc47a4 100644 --- a/spec/mailers/group_smtp_mailer_spec.rb +++ b/spec/mailers/group_smtp_mailer_spec.rb @@ -28,7 +28,7 @@ describe GroupSmtpMailer do end let(:email) do - <<~EOF + <<~EMAIL Delivered-To: bugs@gmail.com MIME-Version: 1.0 From: John Doe @@ -41,7 +41,7 @@ describe GroupSmtpMailer do Hello, How are you doing? - EOF + EMAIL end let(:receiver) do diff --git a/spec/models/theme_field_spec.rb b/spec/models/theme_field_spec.rb index d09c7625b61..f2bf4b88ca2 100644 --- a/spec/models/theme_field_spec.rb +++ b/spec/models/theme_field_spec.rb @@ -92,10 +92,10 @@ describe ThemeField do HTML - extracted = <<~JavaScript + extracted = <<~JS var a = 10 var b = 10 - JavaScript + JS theme_field = ThemeField.create!(theme_id: 1, target_id: 0, name: "header", value: html) theme_field.ensure_baked! diff --git a/spec/models/theme_spec.rb b/spec/models/theme_spec.rb index 50424e2c477..17175164084 100644 --- a/spec/models/theme_spec.rb +++ b/spec/models/theme_spec.rb @@ -326,10 +326,10 @@ HTML expect(scss).to include("font-size:30px") # Escapes correctly. If not, compiling this would throw an exception - setting.value = <<~MULTILINE + setting.value = <<~CSS \#{$fakeinterpolatedvariable} andanothervalue 'withquotes'; margin: 0; - MULTILINE + CSS theme.set_field(target: :common, name: :scss, value: 'body {font-size: quote($font-size)}') theme.save! diff --git a/spec/models/topic_embed_spec.rb b/spec/models/topic_embed_spec.rb index abd7cd57f66..9c434a6fd14 100644 --- a/spec/models/topic_embed_spec.rb +++ b/spec/models/topic_embed_spec.rb @@ -390,10 +390,10 @@ describe TopicEmbed do it "handles malformed links" do url = "https://somesource.com" - contents = <<~CONTENT + contents = <<~HTML hello world new post hello some image - CONTENT + HTML raw = TopicEmbed.absolutize_urls(url, contents) expect(raw).to eq(contents) diff --git a/spec/requests/admin/backups_controller_spec.rb b/spec/requests/admin/backups_controller_spec.rb index 673d42dee28..01a0732b991 100644 --- a/spec/requests/admin/backups_controller_spec.rb +++ b/spec/requests/admin/backups_controller_spec.rb @@ -454,14 +454,14 @@ RSpec.describe Admin::BackupsController do BackupRestore::S3BackupStore.any_instance.stubs(:temporary_upload_path).returns( "temp/default/#{test_bucket_prefix}/28fccf8259bbe75b873a2bd2564b778c/2u98j832nx93272x947823.gz" ) - create_multipart_result = <<~BODY + create_multipart_result = <<~XML \n s3-backup-bucket temp/default/#{test_bucket_prefix}/28fccf8259bbe75b873a2bd2564b778c/2u98j832nx93272x947823.gz #{mock_multipart_upload_id} - BODY + XML stub_request(:post, "https://s3-backup-bucket.s3.us-west-1.amazonaws.com/temp/default/#{test_bucket_prefix}/28fccf8259bbe75b873a2bd2564b778c/2u98j832nx93272x947823.gz?uploads"). to_return(status: 200, body: create_multipart_result) end diff --git a/spec/requests/api/search_spec.rb b/spec/requests/api/search_spec.rb index dc9f63fc769..5335b465f76 100644 --- a/spec/requests/api/search_spec.rb +++ b/spec/requests/api/search_spec.rb @@ -20,7 +20,7 @@ describe 'groups' do in: :query, type: :string, example: 'api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic', - description: <<~HEREDOC + description: <<~MD The query string needs to be url encoded and is made up of the following options: - Search term. This is just a string. Usually it would be the first item in the query. - `@`: Use the `@` followed by the username to specify posts by this user. @@ -44,7 +44,7 @@ describe 'groups' do curl -i -sS -X GET -G "http://localhost:4200/search.json" \\ --data-urlencode 'q=wordpress @scossar #fun after:2020-01-01' ``` - HEREDOC + MD ) parameter name: :page, in: :query, type: :integer, example: 1 diff --git a/spec/requests/api/uploads_spec.rb b/spec/requests/api/uploads_spec.rb index 61e13ac002f..55b7d297dd6 100644 --- a/spec/requests/api/uploads_spec.rb +++ b/spec/requests/api/uploads_spec.rb @@ -52,7 +52,7 @@ describe 'uploads' do tags 'Uploads' operationId 'generatePresignedPut' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT Direct external uploads bypass the usual method of creating uploads via the POST /uploads route, and upload directly to an external provider, which by default is S3. This route begins the process, and will return @@ -66,7 +66,7 @@ describe 'uploads' do destination in the external storage service. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_generate_presigned_put_request') parameter name: :params, in: :body, schema: expected_request_schema @@ -108,7 +108,7 @@ describe 'uploads' do tags 'Uploads' operationId 'completeExternalUpload' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT Completes an external upload initialized with /get-presigned-put. The file will be moved from its temporary location in external storage to a final destination in the S3 bucket. An Upload record will also be @@ -119,7 +119,7 @@ describe 'uploads' do file was uploaded. The file size will be compared for the same reason. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_complete_external_upload_request') parameter name: :params, in: :body, schema: expected_request_schema @@ -154,12 +154,12 @@ describe 'uploads' do tags 'Uploads' operationId 'createMultipartUpload' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT Creates a multipart upload in the external storage provider, storing a temporary reference to the external upload similar to /get-presigned-put. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_create_multipart_request') parameter name: :params, in: :body, schema: expected_request_schema @@ -200,7 +200,7 @@ describe 'uploads' do tags 'Uploads' operationId 'batchPresignMultipartParts' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT Multipart uploads are uploaded in chunks or parts to individual presigned URLs, similar to the one generated by /generate-presigned-put. The part numbers provided must be between 1 and 10000. The total number of parts @@ -215,7 +215,7 @@ describe 'uploads' do because this is needed to complete the multipart upload. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_batch_presign_multipart_parts_request') parameter name: :params, in: :body, schema: expected_request_schema @@ -255,13 +255,13 @@ describe 'uploads' do tags 'Uploads' operationId 'abortMultipart' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT This endpoint aborts the multipart upload initiated with /create-multipart. This should be used when cancelling the upload. It does not matter if parts were already uploaded into the external storage provider. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_abort_multipart_request') parameter name: :params, in: :body, schema: expected_request_schema @@ -299,7 +299,7 @@ describe 'uploads' do tags 'Uploads' operationId 'completeMultipart' consumes 'application/json' - description <<~HEREDOC + description <<~TEXT Completes the multipart upload in the external store, and copies the file from its temporary location to its final location in the store. All of the parts must have been uploaded to the external storage provider. @@ -307,7 +307,7 @@ describe 'uploads' do to its final location. #{direct_uploads_disclaimer} - HEREDOC + TEXT expected_request_schema = load_spec_schema('upload_complete_multipart_request') parameter name: :params, in: :body, schema: expected_request_schema diff --git a/spec/requests/metadata_controller_spec.rb b/spec/requests/metadata_controller_spec.rb index a0037c05b95..2245c8f8935 100644 --- a/spec/requests/metadata_controller_spec.rb +++ b/spec/requests/metadata_controller_spec.rb @@ -125,13 +125,13 @@ RSpec.describe MetadataController do end it 'returns the right output' do - SiteSetting.app_association_android = <<~EOF + SiteSetting.app_association_android = <<~JSON [{ "relation": ["delegate_permission/common.handle_all_urls"], "target" : { "namespace": "android_app", "package_name": "com.example.app", "sha256_cert_fingerprints": ["hash_of_app_certificate"] } }] - EOF + JSON get "/.well-known/assetlinks.json" expect(response.headers["Cache-Control"]).to eq('max-age=60, private') @@ -150,13 +150,13 @@ RSpec.describe MetadataController do end it 'returns the right output' do - SiteSetting.app_association_ios = <<~EOF + SiteSetting.app_association_ios = <<~JSON { "applinks": { "apps": [] } } - EOF + JSON get "/apple-app-site-association" expect(response.status).to eq(200) diff --git a/spec/requests/uploads_controller_spec.rb b/spec/requests/uploads_controller_spec.rb index 4043c018c81..94531e6c0c3 100644 --- a/spec/requests/uploads_controller_spec.rb +++ b/spec/requests/uploads_controller_spec.rb @@ -831,14 +831,14 @@ describe UploadsController do FileStore::S3Store.any_instance.stubs(:temporary_upload_path).returns( "uploads/default/#{test_bucket_prefix}/temp/28fccf8259bbe75b873a2bd2564b778c/test.png" ) - create_multipart_result = <<~BODY + create_multipart_result = <<~XML \n s3-upload-bucket uploads/default/#{test_bucket_prefix}/temp/28fccf8259bbe75b873a2bd2564b778c/test.png #{mock_multipart_upload_id} - BODY + XML stub_request( :post, "https://s3-upload-bucket.s3.us-west-1.amazonaws.com/uploads/default/#{test_bucket_prefix}/temp/28fccf8259bbe75b873a2bd2564b778c/test.png?uploads" @@ -948,7 +948,7 @@ describe UploadsController do end def stub_list_multipart_request - list_multipart_result = <<~BODY + list_multipart_result = <<~XML \n s3-upload-bucket @@ -974,7 +974,7 @@ describe UploadsController do STANDARD - BODY + XML stub_request(:get, "https://s3-upload-bucket.s3.us-west-1.amazonaws.com/#{external_upload_stub.key}?max-parts=1&uploadId=#{mock_multipart_upload_id}").to_return({ status: 200, body: list_multipart_result }) end @@ -1092,7 +1092,7 @@ describe UploadsController do end def stub_list_multipart_request - list_multipart_result = <<~BODY + list_multipart_result = <<~XML \n s3-upload-bucket @@ -1118,7 +1118,7 @@ describe UploadsController do STANDARD - BODY + XML stub_request(:get, "#{upload_base_url}/#{external_upload_stub.key}?max-parts=1&uploadId=#{mock_multipart_upload_id}").to_return({ status: 200, body: list_multipart_result }) end diff --git a/spec/services/external_upload_manager_spec.rb b/spec/services/external_upload_manager_spec.rb index f7abdd8b136..d6de0da8fde 100644 --- a/spec/services/external_upload_manager_spec.rb +++ b/spec/services/external_upload_manager_spec.rb @@ -292,14 +292,14 @@ RSpec.describe ExternalUploadManager do end def copy_object_result - <<~BODY + <<~XML \n 2021-07-19T04:10:41.000Z "#{etag}" - BODY + XML end def stub_copy_object diff --git a/spec/services/post_alerter_spec.rb b/spec/services/post_alerter_spec.rb index 9fe7c166fa6..90d5db509d5 100644 --- a/spec/services/post_alerter_spec.rb +++ b/spec/services/post_alerter_spec.rb @@ -175,9 +175,9 @@ describe PostAlerter do post = Fabricate(:post, topic: pm, user: user1) TopicUser.change(user1.id, pm.id, notification_level: TopicUser.notification_levels[:regular]) - quote_raw = <<~STRING + quote_raw = <<~MD [quote="#{user1.username}, post:1, topic:#{pm.id}"]#{post.raw}[/quote] - STRING + MD expect { create_post_with_alerts( @@ -190,9 +190,9 @@ describe PostAlerter do group.add(admin) TopicUser.change(user2.id, pm.id, notification_level: TopicUser.notification_levels[:regular]) - quote_raw = <<~STRING + quote_raw = <<~MD [quote="#{user2.username}, post:1, topic:#{pm.id}"]#{op.raw}[/quote] - STRING + MD expect { create_post_with_alerts( @@ -1566,7 +1566,7 @@ describe PostAlerter do end def create_post_with_incoming - raw_mail = <<~MAIL + raw_mail = <<~EMAIL From: Foo To: discourse@example.com Cc: bar@discourse.org, jim@othersite.com @@ -1578,7 +1578,7 @@ describe PostAlerter do Content-Transfer-Encoding: 7bit This is the first email. - MAIL + EMAIL Email::Receiver.new(raw_mail, {}).process! end @@ -1716,7 +1716,7 @@ describe PostAlerter do email = ActionMailer::Base.deliveries.last # the reply post from someone who was emailed - reply_raw_mail = <<~MAIL + reply_raw_mail = <<~EMAIL From: Bar To: discourse@example.com Cc: someothernewcc@baz.com, finalnewcc@doom.com @@ -1729,7 +1729,7 @@ describe PostAlerter do Content-Transfer-Encoding: 7bit Hey here is my reply! - MAIL + EMAIL reply_post_from_email = nil expect { @@ -1767,7 +1767,7 @@ describe PostAlerter do email = ActionMailer::Base.deliveries.last # the reply post from someone who was emailed - reply_raw_mail = <<~MAIL + reply_raw_mail = <<~EMAIL From: Foo To: discourse@example.com Cc: someothernewcc@baz.com, finalnewcc@doom.com @@ -1780,7 +1780,7 @@ describe PostAlerter do Content-Transfer-Encoding: 7bit I am ~~Commander Shepherd~~ the OP and I approve of this message. - MAIL + EMAIL reply_post_from_email = nil expect { @@ -1811,7 +1811,7 @@ describe PostAlerter do # this is a special case where we are not CC'ing on the original email, # only on the follow up email - raw_mail = <<~MAIL + raw_mail = <<~EMAIL From: Foo To: discourse@example.com Subject: Full email group username flow @@ -1822,7 +1822,7 @@ describe PostAlerter do Content-Transfer-Encoding: 7bit This is the first email. - MAIL + EMAIL incoming_email_post = Email::Receiver.new(raw_mail, {}).process! topic = incoming_email_post.topic @@ -1833,7 +1833,7 @@ describe PostAlerter do email = ActionMailer::Base.deliveries.last # the reply post from the OP, cc'ing new people in - reply_raw_mail = <<~MAIL + reply_raw_mail = <<~EMAIL From: Foo To: discourse@example.com Cc: someothernewcc@baz.com, finalnewcc@doom.com @@ -1846,7 +1846,7 @@ describe PostAlerter do Content-Transfer-Encoding: 7bit I am inviting my mates to this email party. - MAIL + EMAIL reply_post_from_email = nil expect { diff --git a/spec/swagger_helper.rb b/spec/swagger_helper.rb index 884b2029490..537c216fe02 100644 --- a/spec/swagger_helper.rb +++ b/spec/swagger_helper.rb @@ -14,7 +14,7 @@ def load_spec_schema(name) end def api_docs_description - <<~HEREDOC + <<~MD This page contains the documentation on how to use Discourse through API calls. > Note: For any endpoints not listed you can follow the @@ -71,11 +71,11 @@ def api_docs_description If an endpoint accepts a boolean be sure to specify it as a lowercase `true` or `false` value unless noted otherwise. - HEREDOC + MD end def direct_uploads_disclaimer - <<~HEREDOC + <<~MD You must have the correct permissions and CORS settings configured in your external provider. We support AWS S3 as the default. See: @@ -83,7 +83,7 @@ def direct_uploads_disclaimer An external file store must be set up and `enable_direct_s3_uploads` must be set to true for this endpoint to function. - HEREDOC + MD end RSpec.configure do |config|