diff --git a/app/controllers/liquid_tags_controller.rb b/app/controllers/liquid_tags_controller.rb index 6e2db6e61..c039cc2a7 100644 --- a/app/controllers/liquid_tags_controller.rb +++ b/app/controllers/liquid_tags_controller.rb @@ -1,7 +1,7 @@ class LiquidTagsController < ApplicationController before_action :authenticate_user! - FILTER_REGEX = /^(?:NullTag|Liquid::)/.freeze + FILTER_REGEX = /^(?:NullTag|Liquid::)/ def index custom_tags = Liquid::Template.tags.filter_map do |name, tag| diff --git a/app/controllers/sitemaps_controller.rb b/app/controllers/sitemaps_controller.rb index 612394a4a..acba7a896 100644 --- a/app/controllers/sitemaps_controller.rb +++ b/app/controllers/sitemaps_controller.rb @@ -1,7 +1,7 @@ class SitemapsController < ApplicationController before_action :set_cache_control_headers, only: %i[show] - SITEMAP_REGEX = /\Asitemap-(?[A-Z][a-z][a-z]-\d{4})\.xml\z/.freeze + SITEMAP_REGEX = /\Asitemap-(?[A-Z][a-z][a-z]-\d{4})\.xml\z/ def show match = params[:sitemap].match(SITEMAP_REGEX) diff --git a/app/liquid_tags/asciinema_tag.rb b/app/liquid_tags/asciinema_tag.rb index 8c639fa46..36144c764 100644 --- a/app/liquid_tags/asciinema_tag.rb +++ b/app/liquid_tags/asciinema_tag.rb @@ -1,6 +1,6 @@ class AsciinemaTag < LiquidTagBase PARTIAL = "liquids/asciinema".freeze - ASCIINEMA_URL_REGEX = %r{https://asciinema.org/a/(?\d+)}.freeze + ASCIINEMA_URL_REGEX = %r{https://asciinema.org/a/(?\d+)} def initialize(_tag_name, id, _parse_context) super diff --git a/app/liquid_tags/codepen_tag.rb b/app/liquid_tags/codepen_tag.rb index 4446cff31..eb6014566 100644 --- a/app/liquid_tags/codepen_tag.rb +++ b/app/liquid_tags/codepen_tag.rb @@ -2,7 +2,6 @@ class CodepenTag < LiquidTagBase PARTIAL = "liquids/codepen".freeze URL_REGEXP = %r{\A(http|https)://(codepen\.io|codepen\.io/team)/[a-zA-Z0-9_\-]{1,30}/pen/([a-zA-Z0-9]{5,32})/{0,1}\z} - .freeze def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/codesandbox_tag.rb b/app/liquid_tags/codesandbox_tag.rb index ba31bd1cc..0d136fc0a 100644 --- a/app/liquid_tags/codesandbox_tag.rb +++ b/app/liquid_tags/codesandbox_tag.rb @@ -5,7 +5,6 @@ class CodesandboxTag < LiquidTagBase \A(module=([a-zA-Z0-9\-_/.@%])+)\Z| \A(runonclick=((0|1){1}))\Z| \Aview=(editor|split|preview)\Z}x - .freeze def initialize(_tag_name, id, _parse_context) super diff --git a/app/liquid_tags/dotnet_fiddle_tag.rb b/app/liquid_tags/dotnet_fiddle_tag.rb index 0d05456e2..a617ea64d 100644 --- a/app/liquid_tags/dotnet_fiddle_tag.rb +++ b/app/liquid_tags/dotnet_fiddle_tag.rb @@ -2,7 +2,7 @@ require "uri" class DotnetFiddleTag < LiquidTagBase PARTIAL = "liquids/dotnetfiddle".freeze - LINK_REGEXP = %r{\A(https)://(dotnetfiddle\.net)/(Widget)/[a-zA-Z0-9\-/]*\z}.freeze + LINK_REGEXP = %r{\A(https)://(dotnetfiddle\.net)/(Widget)/[a-zA-Z0-9\-/]*\z} def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/gist_tag.rb b/app/liquid_tags/gist_tag.rb index a509c86fc..9f3fb19c2 100644 --- a/app/liquid_tags/gist_tag.rb +++ b/app/liquid_tags/gist_tag.rb @@ -2,7 +2,6 @@ class GistTag < LiquidTagBase PARTIAL = "liquids/gist".freeze VALID_LINK_REGEXP = %r{\Ahttps://gist\.github\.com/([a-zA-Z0-9](-?[a-zA-Z0-9]){0,38})/([a-zA-Z0-9]){1,32}(/[a-zA-Z0-9]+)?\Z} - .freeze def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/git_pitch_tag.rb b/app/liquid_tags/git_pitch_tag.rb index 0147ecd92..17fdd82d2 100644 --- a/app/liquid_tags/git_pitch_tag.rb +++ b/app/liquid_tags/git_pitch_tag.rb @@ -1,6 +1,6 @@ class GitPitchTag < LiquidTagBase PARTIAL = "liquids/gitpitch".freeze - URL_REGEXP = %r{(http|https)://gitpitch.com/[a-zA-Z0-9\-/]*}.freeze + URL_REGEXP = %r{(http|https)://gitpitch.com/[a-zA-Z0-9\-/]*} def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/github_tag/github_readme_tag.rb b/app/liquid_tags/github_tag/github_readme_tag.rb index 1ab957a7f..0e4464280 100644 --- a/app/liquid_tags/github_tag/github_readme_tag.rb +++ b/app/liquid_tags/github_tag/github_readme_tag.rb @@ -1,7 +1,7 @@ class GithubTag class GithubReadmeTag PARTIAL = "liquids/github_readme".freeze - GITHUB_DOMAIN_REGEXP = %r{.*github.com/}.freeze + GITHUB_DOMAIN_REGEXP = %r{.*github.com/} OPTION_NO_README = "no-readme".freeze VALID_OPTIONS = [OPTION_NO_README].freeze diff --git a/app/liquid_tags/glitch_tag.rb b/app/liquid_tags/glitch_tag.rb index 4a1a4f2a3..ebe69dcba 100644 --- a/app/liquid_tags/glitch_tag.rb +++ b/app/liquid_tags/glitch_tag.rb @@ -2,9 +2,9 @@ class GlitchTag < LiquidTagBase attr_accessor :uri PARTIAL = "liquids/glitch".freeze - ID_REGEXP = /\A[a-zA-Z0-9\-]{1,110}\z/.freeze - TILDE_PREFIX_REGEXP = /\A~/.freeze - OPTION_REGEXP = /(app|code|no-files|preview-first|no-attribution|file=\w(\.\w)?)/.freeze + ID_REGEXP = /\A[a-zA-Z0-9\-]{1,110}\z/ + TILDE_PREFIX_REGEXP = /\A~/ + OPTION_REGEXP = /(app|code|no-files|preview-first|no-attribution|file=\w(\.\w)?)/ OPTIONS_TO_QUERY_PAIR = { "app" => %w[previewSize 100], "code" => %w[previewSize 0], diff --git a/app/liquid_tags/js_fiddle_tag.rb b/app/liquid_tags/js_fiddle_tag.rb index 6916f16ce..d0adad45f 100644 --- a/app/liquid_tags/js_fiddle_tag.rb +++ b/app/liquid_tags/js_fiddle_tag.rb @@ -1,7 +1,7 @@ class JsFiddleTag < LiquidTagBase PARTIAL = "liquids/jsfiddle".freeze - OPTION_REGEXP = /\A(js|html|css|result|,)*\z/.freeze - LINK_REGEXP = %r{\A(http|https)://(jsfiddle\.net)/[a-zA-Z0-9\-/]*\z}.freeze + OPTION_REGEXP = /\A(js|html|css|result|,)*\z/ + LINK_REGEXP = %r{\A(http|https)://(jsfiddle\.net)/[a-zA-Z0-9\-/]*\z} def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/jsitor_tag.rb b/app/liquid_tags/jsitor_tag.rb index 7f92c46b3..028faeb05 100644 --- a/app/liquid_tags/jsitor_tag.rb +++ b/app/liquid_tags/jsitor_tag.rb @@ -1,7 +1,7 @@ class JsitorTag < LiquidTagBase PARTIAL = "liquids/jsitor".freeze - URL_REGEXP = %r{\A(https|http)://jsitor\.com/embed/\w+[-?a-zA-Z&]*\Z}.freeze - ID_REGEXP = /\A[\w&?-]+\Z/.freeze + URL_REGEXP = %r{\A(https|http)://jsitor\.com/embed/\w+[-?a-zA-Z&]*\Z} + ID_REGEXP = /\A[\w&?-]+\Z/ def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/kotlin_tag.rb b/app/liquid_tags/kotlin_tag.rb index f3f34f566..aecbfc3c2 100644 --- a/app/liquid_tags/kotlin_tag.rb +++ b/app/liquid_tags/kotlin_tag.rb @@ -1,6 +1,6 @@ class KotlinTag < LiquidTagBase PARTIAL = "liquids/kotlin".freeze - PARAM_REGEXP = /\A[a-zA-Z0-9]+\z/.freeze + PARAM_REGEXP = /\A[a-zA-Z0-9]+\z/ def initialize(_tag_name, link, _parse_context) super diff --git a/app/liquid_tags/reddit_tag.rb b/app/liquid_tags/reddit_tag.rb index 5b0ff4be9..40c2cd6fa 100644 --- a/app/liquid_tags/reddit_tag.rb +++ b/app/liquid_tags/reddit_tag.rb @@ -2,7 +2,7 @@ class RedditTag < LiquidTagBase include ActionView::Helpers::SanitizeHelper PARTIAL = "liquids/reddit".freeze - URL_REGEXP = %r{\Ahttps://(www.)?reddit.com}.freeze + URL_REGEXP = %r{\Ahttps://(www.)?reddit.com} def initialize(_tag_name, url, _parse_context) super diff --git a/app/liquid_tags/spotify_tag.rb b/app/liquid_tags/spotify_tag.rb index 2984d08b4..df472adc8 100644 --- a/app/liquid_tags/spotify_tag.rb +++ b/app/liquid_tags/spotify_tag.rb @@ -1,7 +1,7 @@ class SpotifyTag < LiquidTagBase PARTIAL = "liquids/spotify".freeze - URI_REGEXP = /spotify:(track|artist|playlist|album|episode|show):\w{22}/.freeze - URI_PLAYLIST_REGEXP = /spotify:(user):([a-zA-Z0-9]+):playlist:\w{22}/.freeze # legacy support + URI_REGEXP = /spotify:(track|artist|playlist|album|episode|show):\w{22}/ + URI_PLAYLIST_REGEXP = /spotify:(user):([a-zA-Z0-9]+):playlist:\w{22}/ # legacy support TYPE_HEIGHT = { track: 80, user: 380, diff --git a/app/liquid_tags/stackblitz_tag.rb b/app/liquid_tags/stackblitz_tag.rb index 7a37fdac5..711ef5b77 100644 --- a/app/liquid_tags/stackblitz_tag.rb +++ b/app/liquid_tags/stackblitz_tag.rb @@ -1,8 +1,8 @@ class StackblitzTag < LiquidTagBase PARTIAL = "liquids/stackblitz".freeze - ID_REGEXP = /\A[a-zA-Z0-9\-]{0,60}\z/.freeze - VIEW_OPTION_REGEXP = /\Aview=(preview|editor|both)\z/.freeze - FILE_OPTION_REGEXP = /\Afile=(.*)\z/.freeze + ID_REGEXP = /\A[a-zA-Z0-9\-]{0,60}\z/ + VIEW_OPTION_REGEXP = /\Aview=(preview|editor|both)\z/ + FILE_OPTION_REGEXP = /\Afile=(.*)\z/ def initialize(_tag_name, id, _parse_context) super diff --git a/app/liquid_tags/stackexchange_tag.rb b/app/liquid_tags/stackexchange_tag.rb index 426ad089f..2aa5bce1f 100644 --- a/app/liquid_tags/stackexchange_tag.rb +++ b/app/liquid_tags/stackexchange_tag.rb @@ -9,7 +9,7 @@ class StackexchangeTag < LiquidTagBase "question" => "!*1SgQGDOL9bPBHULz9sKS.y6qv7V9fYNszvdhDuv5", "site" => "!mWxO_PNa4i" }.freeze - ID_REGEXP = /\A\d{1,20}\z/.freeze + ID_REGEXP = /\A\d{1,20}\z/ attr_reader :site, :post_type diff --git a/app/liquid_tags/tweet_tag.rb b/app/liquid_tags/tweet_tag.rb index 72ab4e8f2..fbf3983c8 100644 --- a/app/liquid_tags/tweet_tag.rb +++ b/app/liquid_tags/tweet_tag.rb @@ -1,7 +1,7 @@ class TweetTag < LiquidTagBase include ActionView::Helpers::AssetTagHelper PARTIAL = "liquids/tweet".freeze - ID_REGEXP = /\A\d{10,20}\z/.freeze # id must be all numbers between 10 and 20 chars + ID_REGEXP = /\A\d{10,20}\z/ # id must be all numbers between 10 and 20 chars SCRIPT = <<~JAVASCRIPT.freeze var videoPreviews = document.getElementsByClassName("ltag__twitter-tweet__media__video-wrapper"); diff --git a/app/liquid_tags/twitter_timeline_tag.rb b/app/liquid_tags/twitter_timeline_tag.rb index 080fc626e..ad4df03a2 100644 --- a/app/liquid_tags/twitter_timeline_tag.rb +++ b/app/liquid_tags/twitter_timeline_tag.rb @@ -2,7 +2,7 @@ class TwitterTimelineTag < LiquidTagBase include ActionView::Helpers::AssetTagHelper PARTIAL = "liquids/twitter_timeline".freeze - URL_REGEXP = %r{\Ahttps://twitter\.com/[a-zA-Z0-9]+/timelines/\d+\Z}.freeze + URL_REGEXP = %r{\Ahttps://twitter\.com/[a-zA-Z0-9]+/timelines/\d+\Z} SCRIPT = <<~JAVASCRIPT.freeze diff --git a/app/liquid_tags/wikipedia_tag.rb b/app/liquid_tags/wikipedia_tag.rb index a14a727cc..8e21c0626 100644 --- a/app/liquid_tags/wikipedia_tag.rb +++ b/app/liquid_tags/wikipedia_tag.rb @@ -1,6 +1,6 @@ class WikipediaTag < LiquidTagBase PARTIAL = "liquids/wikipedia".freeze - WIKI_REGEXP = %r{\Ahttps?://([a-z-]+)\.wikipedia.org/wiki/(\S+)\z}.freeze + WIKI_REGEXP = %r{\Ahttps?://([a-z-]+)\.wikipedia.org/wiki/(\S+)\z} TEXT_CLEANUP_XPATH = "//div[contains(@class, 'noprint') or contains(@class, 'hatnote')] | " \ "//span[@class='mw-ref'] | //figure | //sup".freeze diff --git a/app/models/comment.rb b/app/models/comment.rb index d1ce8fb3f..213eb3cda 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -5,7 +5,7 @@ class Comment < ApplicationRecord include PgSearch::Model include Reactable - BODY_MARKDOWN_SIZE_RANGE = (1..25_000).freeze + BODY_MARKDOWN_SIZE_RANGE = (1..25_000) COMMENTABLE_TYPES = %w[Article PodcastEpisode].freeze @@ -18,7 +18,7 @@ class Comment < ApplicationRecord .+? # host (?::\d+)? # optional port \z - }x.freeze + }x # The date that we began limiting the number of user mentions in a comment. MAX_USER_MENTION_LIVE_AT = Time.utc(2021, 3, 12).freeze diff --git a/app/models/github_issue.rb b/app/models/github_issue.rb index fadb88e18..5df1940ce 100644 --- a/app/models/github_issue.rb +++ b/app/models/github_issue.rb @@ -1,11 +1,11 @@ # NOTE: we are using `GithubIssue` to store issues, pull requests and comments class GithubIssue < ApplicationRecord CATEGORIES = %w[issue issue_comment].freeze - API_URL_REGEXP = %r{\Ahttps://api.github.com/repos/.*\z}.freeze - PATH_COMMENT_REGEXP = %r{/issues/comments/}.freeze - PATH_ISSUE_REGEXP = %r{/issues/}.freeze - PATH_PULL_REQUEST_REGEXP = %r{/pulls/}.freeze - PATH_REPO_REGEXP = %r{.*github.com/repos/}.freeze + API_URL_REGEXP = %r{\Ahttps://api.github.com/repos/.*\z} + PATH_COMMENT_REGEXP = %r{/issues/comments/} + PATH_ISSUE_REGEXP = %r{/issues/} + PATH_PULL_REQUEST_REGEXP = %r{/pulls/} + PATH_REPO_REGEXP = %r{.*github.com/repos/} serialize :issue_serialized, Hash diff --git a/app/models/navigation_link.rb b/app/models/navigation_link.rb index a73bdd6cb..f5f66a546 100644 --- a/app/models/navigation_link.rb +++ b/app/models/navigation_link.rb @@ -1,5 +1,5 @@ class NavigationLink < ApplicationRecord - SVG_REGEXP = //im.freeze + SVG_REGEXP = //im before_validation :allow_relative_url, if: :url? before_save :strip_local_hostname, if: :url? diff --git a/app/models/organization.rb b/app/models/organization.rb index 83051975a..3e087aa82 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,9 +1,9 @@ class Organization < ApplicationRecord include CloudinaryHelper - COLOR_HEX_REGEXP = /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/.freeze - INTEGER_REGEXP = /\A\d+\z/.freeze - SLUG_REGEXP = /\A[a-zA-Z0-9\-_]+\z/.freeze + COLOR_HEX_REGEXP = /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/ + INTEGER_REGEXP = /\A\d+\z/ + SLUG_REGEXP = /\A[a-zA-Z0-9\-_]+\z/ MESSAGES = { integer_only: "Integer only. No sign allowed.", reserved_word: "%s is a reserved word. Contact site admins for help registering your organization." diff --git a/app/models/settings/general.rb b/app/models/settings/general.rb index 01b60c68b..04423e99b 100644 --- a/app/models/settings/general.rb +++ b/app/models/settings/general.rb @@ -8,7 +8,7 @@ module Settings # the cache, or call Settings::General.clear_cache cache_prefix { "v1" } - HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/.freeze + HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/ LIGHTNING_ICON = File.read(Rails.root.join("app/assets/images/lightning.svg")).freeze STACK_ICON = File.read(Rails.root.join("app/assets/images/stack.svg")).freeze diff --git a/app/models/settings/user_experience.rb b/app/models/settings/user_experience.rb index 0ffb2f9bf..fb9fe482e 100644 --- a/app/models/settings/user_experience.rb +++ b/app/models/settings/user_experience.rb @@ -3,7 +3,7 @@ module Settings class UserExperience < RailsSettings::Base self.table_name = :settings_user_experiences - HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/.freeze + HEX_COLOR_REGEX = /\A#(\h{6}|\h{3})\z/ # The configuration is cached, change this if you want to force update # the cache, or call Settings::UserExperience.clear_cache diff --git a/app/models/tag.rb b/app/models/tag.rb index 15e3f3a74..bdfcdb12e 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -9,7 +9,7 @@ class Tag < ActsAsTaggableOn::Tag include PgSearch::Model ALLOWED_CATEGORIES = %w[uncategorized language library tool site_mechanic location subcommunity].freeze - HEX_COLOR_REGEXP = /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/.freeze + HEX_COLOR_REGEXP = /\A#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/ belongs_to :badge, optional: true belongs_to :mod_chat_channel, class_name: "ChatChannel", optional: true diff --git a/app/models/users/setting.rb b/app/models/users/setting.rb index 3b45cb5c1..65bf52371 100644 --- a/app/models/users/setting.rb +++ b/app/models/users/setting.rb @@ -2,7 +2,7 @@ module Users class Setting < ApplicationRecord self.table_name_prefix = "users_" - HEX_COLOR_REGEXP = /\A#?(?:\h{6}|\h{3})\z/.freeze + HEX_COLOR_REGEXP = /\A#?(?:\h{6}|\h{3})\z/ belongs_to :user, touch: true scope :with_feed, -> { where.not(feed_url: [nil, ""]) } diff --git a/app/sanitizers/rendered_markdown_scrubber.rb b/app/sanitizers/rendered_markdown_scrubber.rb index cbf1e3b91..0142c52b3 100644 --- a/app/sanitizers/rendered_markdown_scrubber.rb +++ b/app/sanitizers/rendered_markdown_scrubber.rb @@ -1,5 +1,5 @@ class RenderedMarkdownScrubber < Rails::Html::PermitScrubber - LIQUID_TAG_SYNTAX_REGEX = /\{%|%\}/.freeze + LIQUID_TAG_SYNTAX_REGEX = /\{%|%\}/ def initialize super diff --git a/app/services/color/compare_hex.rb b/app/services/color/compare_hex.rb index 46ce603ae..467cfb551 100644 --- a/app/services/color/compare_hex.rb +++ b/app/services/color/compare_hex.rb @@ -3,7 +3,7 @@ module Color ACCENT_MODIFIERS = [1.14, 1.08, 1.06, 0.96, 0.9, 0.8, 0.7, 0.6].freeze BRIGHTNESS_FORMAT = "#%02x%02x%02x".freeze OPACITY_FORMAT = "rgba(%d, %d, %d, %.2f)".freeze - RGB_REGEX = /^#?(?..)(?..)(?..)$/.freeze + RGB_REGEX = /^#?(?..)(?..)(?..)$/ def initialize(hexes) @hexes = hexes.sort diff --git a/app/services/error_messages/clean.rb b/app/services/error_messages/clean.rb index d31a8a49d..9ccdd6b9f 100644 --- a/app/services/error_messages/clean.rb +++ b/app/services/error_messages/clean.rb @@ -1,6 +1,6 @@ module ErrorMessages class Clean - FRONTMATTER_ERROR = /expected key while parsing a block mapping at line/.freeze + FRONTMATTER_ERROR = /expected key while parsing a block mapping at line/ REPLACEMENT_ERROR = "There was a problem parsing the front-matter YAML. " \ "Perhaps you need to escape a quote or a colon or something. " \ diff --git a/app/services/markdown_processor/fixer/base.rb b/app/services/markdown_processor/fixer/base.rb index 68e0eb0d6..979d7e949 100644 --- a/app/services/markdown_processor/fixer/base.rb +++ b/app/services/markdown_processor/fixer/base.rb @@ -8,7 +8,7 @@ module MarkdownProcessor # For example # METHODS = %i[add_quotes_to_tile add_quotes_to_description] class Base - FRONT_MATTER_DETECTOR = /-{3}.*?-{3}/m.freeze + FRONT_MATTER_DETECTOR = /-{3}.*?-{3}/m def self.call(markdown) return unless markdown @@ -62,7 +62,7 @@ module MarkdownProcessor end # Match @_username_ that is not preceded by backtick - USERNAME_WITH_UNDERSCORE_REGEXP = /(?https?://)?(?.+?)(?:\d+)?$}.freeze + URI_REGEXP = %r{(?https?://)?(?.+?)(?:\d+)?$} def self.[](key) if ENV.key?(key) diff --git a/lib/liquid/raw.rb b/lib/liquid/raw.rb index 7dc16098f..2f4be755e 100644 --- a/lib/liquid/raw.rb +++ b/lib/liquid/raw.rb @@ -4,7 +4,7 @@ module Liquid class Raw < Block remove_const(:FullTokenPossiblyInvalid) if defined?(FullTokenPossiblyInvalid) - FullTokenPossiblyInvalid = /\A(.*)#{TagStart}\s*(\w+)\s*#{TagEnd}\z/om.freeze # rubocop:disable Naming/ConstantName + FullTokenPossiblyInvalid = /\A(.*)#{TagStart}\s*(\w+)\s*#{TagEnd}\z/om # rubocop:disable Naming/ConstantName end Template.register_tag("raw", Raw)