Class: Awestruct::Handlers::AsciidoctorTiltMatcher

Inherits:
TiltMatcher
  • Object
show all
Defined in:
lib/awestruct/handlers/asciidoctor_handler.rb

Instance Method Summary collapse

Instance Method Details

#match(path) ⇒ Object

Use a lightweight lookup to avoid loading Tilt templates for non-matching paths. Once we are sure this is a match, then attempt to load the Tilt template for AsciiDoc files.



18
19
20
21
22
23
24
# File 'lib/awestruct/handlers/asciidoctor_handler.rb', line 18

def match(path)
  extensions = ['ad', 'adoc', 'asciidoc']
  if (extensions.include? File.extname(path)[1..-1]) 
    return true
  end
  false
end