Sha256: 813231d566ab3f3fc348511002c6b5c85cbce7ccf68c1e9acbf4730bf6623d30

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 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 at: Time.now.utc
        input.build_root.join("index.adoc").make_ancestors.tap { |path| write path, at }
      end

      private

      attr_reader :view, :enricher

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
milestoner-17.5.0 lib/milestoner/builders/ascii_doc.rb
milestoner-17.4.0 lib/milestoner/builders/ascii_doc.rb
milestoner-17.3.0 lib/milestoner/builders/ascii_doc.rb
milestoner-17.2.0 lib/milestoner/builders/ascii_doc.rb
milestoner-17.1.0 lib/milestoner/builders/ascii_doc.rb