Sha256: b599bd8fde0104efb18f94c41fcf58b7cf59ad7fc6932b2e036ff1e131ce56dd

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

# frozen_string_literal: true

module Milestoner
  module CLI
    module Actions
      # Handles listing project status of untagged commit history.
      class Status
        include Milestoner::Import[:logger]

        def initialize(presenter: Presenters::Commit, categorizer: Commits::Categorizer.new, **)
          super(**)
          @presenter = presenter
          @categorizer = categorizer
        end

        def call
          categorizer.call
                     .tap { |records| info "All is quiet." if records.empty? }
                     .map { |record| presenter.new(record).line_item }
                     .each { |line_item| info line_item }
        end

        private

        attr_reader :presenter, :categorizer

        def info(message) = logger.info { message }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
milestoner-15.2.2 lib/milestoner/cli/actions/status.rb
milestoner-15.2.1 lib/milestoner/cli/actions/status.rb