Commit 4012ef72 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Restore Ruby 2.3 compatibility

* Use match instead match?
* Use String#chomp instead of String#delete_prefix
parent 51885661
......@@ -35,7 +35,7 @@ module Banzai
ref_num = link_node[:id].delete_prefix(FOOTNOTE_LINK_ID_PREFIX)
footnote_node = doc.at_css("li[id=#{fn_id(ref_num)}]")
if INTEGER_PATTERN.match?(ref_num) && (footnote_node || modified_footnotes[ref_num])
if INTEGER_PATTERN.match(ref_num) && (footnote_node || modified_footnotes[ref_num])
link_node[:href] += rand_suffix
link_node[:id] += rand_suffix
......
......@@ -44,7 +44,7 @@ module Gitlab
end
def sanitized_source_name(pipeline)
@sanitized_source_name ||= pipeline&.source&.delete_suffix('_event')
@sanitized_source_name ||= pipeline&.source&.chomp('_event')
end
end
end
......
......@@ -16,7 +16,7 @@ module RuboCop
# We use `match?` here instead of RuboCop's AST matching, as this makes
# it far easier to handle nested constants such as `EE::Foo::Bar::Baz`.
line.match?(/(\s|\()(::)?EE::/)
line.match(/(\s|\()(::)?EE::/)
end
def on_send(node)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment