Fix: rubocop offenses (#7769)

Merge pull request 7769
This commit is contained in:
Frank Taillandier 2019-08-04 08:49:34 +02:00 committed by jekyllbot
parent a87ca206da
commit 6a4f8bdbec
3 changed files with 4 additions and 2 deletions

View File

@ -155,7 +155,7 @@ module Jekyll
tag_names.flatten!
tag_names.reverse_each do |tag_name|
next unless liquid_block?(tag_name)
next if head =~ endtag_regex_stash(tag_name)
next if endtag_regex_stash(tag_name).match?(head)
modified = true
head << "\n{% end#{tag_name} %}"

View File

@ -368,6 +368,7 @@ module Jekyll
end
end
# rubocop:disable Performance/RegexpMatch
# return numeric values as numbers for proper sorting
def parse_sort_input(property)
number_like = %r!\A\s*-?(?:\d+\.?\d*|\.\d+)\s*\Z!
@ -375,6 +376,7 @@ module Jekyll
property
end
# rubocop:enable Performance/RegexpMatch
def as_liquid(item)
case item

View File

@ -50,7 +50,7 @@ module Jekyll
# Returns klass type of content files
def read_content(dir, magic_dir, matcher)
@site.reader.get_entries(dir, magic_dir).map do |entry|
next unless entry =~ matcher
next unless matcher.match?(entry)
path = @site.in_source_dir(File.join(dir, magic_dir, entry))
Document.new(path,