Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2022-06-07 07:13:32 +0300
committerEvan Read <eread@gitlab.com>2022-06-07 07:13:32 +0300
commit5f15361cf1d968237f7553de5d8a09fd62c67f7b (patch)
tree5669fe8ad1e343f3c5d7e1687c0a328e33661bac
parented77855b7fab8c2fd082b5626ef4fa8ad6889ca9 (diff)
Fix Performance/RegexpMatch RuboCop offenseseread/fix-regexp-match-rubocop-offenses
-rw-r--r--lib/filters/introduced_in.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/filters/introduced_in.rb b/lib/filters/introduced_in.rb
index 8bcdfb50..8847ec62 100644
--- a/lib/filters/introduced_in.rb
+++ b/lib/filters/introduced_in.rb
@@ -21,7 +21,7 @@ class IntroducedInFilter < Nanoc::Filter
# - "changed <optional text> in"
# - "enabled <optional text> in"
# ...followed by "GitLab"
- next if content !~ %r{(<a href="[^"]+">)?(
+ next unless content.match?(%r{(<a href="[^"]+">)?(
introduced|
enabled|
(re)?moved|
@@ -29,7 +29,7 @@ class IntroducedInFilter < Nanoc::Filter
deprecated|
renamed|
recommended
- )(</a>)?(.*)? (in|to).*GitLab}xmi
+ )(</a>)?(.*)? (in|to).*GitLab}xmi)
new_content = generate(content)
blockquote.replace(new_content)
@@ -40,7 +40,7 @@ class IntroducedInFilter < Nanoc::Filter
def generate(content)
@incremental_id += 1
# If the content is a list of items, collapse the content.
- if content =~ %r{<ul>}i
+ if content.match?(%r{<ul>}i)
%(<div class="introduced-in mb-3">Version history) +
%(<button class="text-expander" type="button" data-toggle="collapse" data-target="#release_version_notes_#{@incremental_id}" aria-expanded="false" aria-controls="release_version_notes_#{@incremental_id}" aria-label="Version history">) +
%(</button>) +