Sha256: 886632a38a54da01292fa8d298d36073bcbf485d08640406763361d932cf8cf6

Contents?: true

Size: 886 Bytes

Versions: 8

Compression:

Stored size: 886 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[:repository, :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

8 entries across 8 versions & 1 rubygems

Version Path
git-lint-4.6.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.5.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.4.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.3.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.2.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.1.0 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.0.1 lib/git/lint/cli/actions/analyze/branch.rb
git-lint-4.0.0 lib/git/lint/cli/actions/analyze/branch.rb