parent
e37ee47219
commit
06eafadcbb
|
@ -3,9 +3,7 @@
|
||||||
module Jekyll
|
module Jekyll
|
||||||
class EntryFilter
|
class EntryFilter
|
||||||
attr_reader :site
|
attr_reader :site
|
||||||
SPECIAL_LEADING_CHARACTERS = [
|
SPECIAL_LEADING_CHAR_REGEX = %r!\A#{Regexp.union([".", "_", "#", "~"])}!o.freeze
|
||||||
".", "_", "#", "~",
|
|
||||||
].freeze
|
|
||||||
|
|
||||||
def initialize(site, base_directory = nil)
|
def initialize(site, base_directory = nil)
|
||||||
@site = site
|
@site = site
|
||||||
|
@ -50,8 +48,8 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def special?(entry)
|
def special?(entry)
|
||||||
SPECIAL_LEADING_CHARACTERS.include?(entry[0..0]) ||
|
SPECIAL_LEADING_CHAR_REGEX.match?(entry) ||
|
||||||
SPECIAL_LEADING_CHARACTERS.include?(File.basename(entry)[0..0])
|
SPECIAL_LEADING_CHAR_REGEX.match?(File.basename(entry))
|
||||||
end
|
end
|
||||||
|
|
||||||
def backup?(entry)
|
def backup?(entry)
|
||||||
|
|
Loading…
Reference in New Issue