class Awestruct::Handlers::TiltMatcher

Public Instance Methods

match(path) click to toggle source

Returns the Tilt template class if a portion of the path is registered to a Tilt template and the Tilt template can be loaded. Returns false if no portions of the path are registered to a Tilt template or the Tilt template cannot be loaded.

# File lib/awestruct/handlers/base_tilt_handler.rb, line 14
def match(path)
  matcher = ::Tilt[File.basename(path)]
  if matcher.nil?
    $LOG.debug(%(Copying #{path})) if Awestruct::Engine.instance.config.verbose && Awestruct::Engine.instance.config.debug
    return false
  end

  # We have our own extra integration with Asciidoctor
  return false if matcher.name.include? 'Asciidoctor'

  matcher
end