Skip to content

Commit

Permalink
style: target Ruby 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyF committed Mar 5, 2020
1 parent e418cf6 commit 824953a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.4
Exclude:
- vendor/**/*
Metrics/BlockLength:
Expand Down
2 changes: 1 addition & 1 deletion jekyll-mentions.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.licenses = ["MIT"]
s.files = ["lib/jekyll-mentions.rb"]

s.required_ruby_version = ">= 2.3.0"
s.required_ruby_version = ">= 2.4.0"

s.add_dependency "html-pipeline", "~> 2.3"
s.add_dependency "jekyll", ">= 3.7", "< 5.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-mentions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def mentionify(doc)
head, opener, tail = content.partition(OPENING_BODY_TAG_REGEX)
body_content, *rest = tail.partition("</body>")

return unless body_content =~ filter_regex
return unless body_content&.match?(filter_regex)

processed_markup = filter_with_mention(src).call(body_content)[:output].to_s
doc.output = String.new(head) << opener << processed_markup << rest.join
else
return unless content =~ filter_regex
return unless content&.match?(filter_regex)

doc.output = filter_with_mention(src).call(content)[:output].to_s
end
Expand Down

0 comments on commit 824953a

Please sign in to comment.