Module: Jekyll::AsciiDoc::Utils

Defined in:
lib/jekyll-asciidoc/utils.rb

Constant Summary collapse

MessageTopic =
'Jekyll AsciiDoc:'
NewLine =
?\n

Class Method Summary collapse

Class Method Details

.has_front_matter?(dlg_method, asciidoc_ext_rx, path) ⇒ Boolean

Checks whether the file at the specified path has front matter. For AsciiDoc files, this method always returns true. Otherwise, it delegates to Utils.has_yaml_header?.

Parameters:

  • dlg_method (Method)

    the delegate method to call if this path is not an AsciiDoc file.

  • asciidoc_ext_rx (Regexp)

    the regular expression to use to check if this path is an AsciiDoc file.

  • path (String)

    the path to check.

Returns:

  • (Boolean)

    whether the file at this path has front matter.



17
18
19
# File 'lib/jekyll-asciidoc/utils.rb', line 17

def has_front_matter? dlg_method, asciidoc_ext_rx, path
  (asciidoc_ext_rx.match? ::File.extname path) || (dlg_method.call path)
end