Sha256: 7b3db17dc989d04bc936db444286a6eadd7bda29e2fdf42cd638d4061ef57d56

Contents?: true

Size: 873 Bytes

Versions: 2

Compression:

Stored size: 873 Bytes

Contents

# frozen_string_literal: true

module Git
  module Lint
    module CLI
      module Actions
        module Analyze
          # Handles analyze action for branch.
          class Branch
            include Git::Lint::Import[:kernel, :logger]

            def initialize analyzer: Analyzer.new, **dependencies
              super(**dependencies)
              @analyzer = analyzer
            end

            def call
              parse
            rescue Errors::Base => error
              logger.error { error.message }
              kernel.abort
            end

            private

            attr_reader :analyzer

            def parse
              analyzer.call do |collector, reporter|
                kernel.puts reporter
                kernel.abort if collector.errors?
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git-lint-5.1.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-5.0.0 lib/git/lint/cli/actions/analyze/branch.rb