class Metanorma::AsciidoctorExtensions::GlobIncludeProcessor

Public Instance Methods

handles?(target) click to toggle source
# File lib/metanorma/asciidoctor_extensions/glob_include_processor.rb, line 12
def handles?(target)
  target.include? "*"
end
process(_doc, reader, target_glob, attributes) click to toggle source
# File lib/metanorma/asciidoctor_extensions/glob_include_processor.rb, line 3
def process(_doc, reader, target_glob, attributes)
  Dir[File.join reader.dir, target_glob].sort.reverse_each do |target|
    content = IO.readlines target
    content.unshift "" unless attributes["adjoin-option"]
    reader.push_include content, target, target, 1, attributes
  end
  reader
end