Sha256: c0e0a2eac8cf02d2afb68b0a699f84a35b5e985dce52dc326c4f0edfa3bd89df

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  module Builders
    # Builds I/O stream output.
    class Stream
      include Milestoner::Import[:input, :kernel]

      using Refinements::Pathname

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

      def call
        enricher.call.fmap do |commits|
          kernel.puts view.call(commits:, layout: input.build_layout, format: :stream).to_s
          kernel
        end
      end

      private

      attr_reader :view, :enricher
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
milestoner-17.6.0 lib/milestoner/builders/stream.rb
milestoner-17.5.0 lib/milestoner/builders/stream.rb
milestoner-17.4.0 lib/milestoner/builders/stream.rb
milestoner-17.3.0 lib/milestoner/builders/stream.rb
milestoner-17.2.0 lib/milestoner/builders/stream.rb
milestoner-17.1.0 lib/milestoner/builders/stream.rb
milestoner-17.0.0 lib/milestoner/builders/stream.rb