Sha256: 1ff5a9e2eccf6dddc41c364ba62cf9911371b27aa631ac4192a71ade01f3aa9b

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  module Builders
    # Builds Markdown page output.
    class ASCIIDoc
      include Milestoner::Import[:input]

      using Refinements::Pathname

      def initialize(view: Views::Milestones::Show.new, enricher: Commits::Enricher.new, **)
        @view = view
        @enricher = enricher
        super(**)
      end

      def call = input.build_root.join("index.adoc").make_ancestors.tap { |path| write path }

      private

      attr_reader :view, :enricher

      def write path
        enricher.call.fmap do |commits|
          path.write view.call commits:, layout: input.build_layout, format: :adoc
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milestoner-17.6.0 lib/milestoner/builders/ascii_doc.rb