Sha256: 23e3c06b35b5f0eb3123df8c0f482e93ca8cfeb268a01ca2e8f127a98e45c291
Contents?: true
Size: 1.18 KB
Versions: 35
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require 'asciidoctor' require 'eac_ruby_utils/core_ext' module Avm module EacAsciidoctorBase0 module Sources class Base class Document enable_simple_cache enable_speaker require_sub __FILE__, include_modules: true common_constructor :source, :parent_document, :basename # Absolute path to the Asciidoctor file. # # @return [Pathname] def body_path root_path.join( ::Avm::EacAsciidoctorBase0::Sources::Base::CONTENT_DOCUMENT_BASENAME ) end # Absolute path to the document's source root. # # @return [Pathname] def root_path source.content_directory.join(subpath) end # @return [Pathname] def subpath parent_document.if_present('.'.to_pathname) { |pd| pd.subpath.join(basename) } end private def children_uncached root_path.children.select(&:directory?) .map { |path| self.class.new(source, self, path.basename) } end end end end end end
Version data entries
35 entries across 35 versions & 2 rubygems