Class: Packwerk::Commands::BaseCommand Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/packwerk/commands/base_command.rb

Overview

This class is abstract.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, configuration:, out:, err_out:, progress_formatter:, offenses_formatter:) ⇒ BaseCommand

Returns a new instance of BaseCommand.

Signature:

  • (

  • Array[String] args,

  • configuration: Configuration,

  • out: (StringIO | IO),

  • err_out: (StringIO | IO),

  • progress_formatter: Formatters::ProgressFormatter,

  • offenses_formatter: OffensesFormatter

  • ) -> void



29
30
31
32
33
34
35
36
# File 'lib/packwerk/commands/base_command.rb', line 29

def initialize(args, configuration:, out:, err_out:, progress_formatter:, offenses_formatter:)
  @args = args
  @configuration = configuration
  @out = out
  @err_out = err_out
  @progress_formatter = progress_formatter
  @offenses_formatter = offenses_formatter
end

Class Method Details

.description(description = nil) ⇒ Object

Signature:

  • (?String? description) -> String



12
13
14
15
16
17
18
# File 'lib/packwerk/commands/base_command.rb', line 12

def description(description = nil)
  if description
    @description = description
  else
    @description
  end
end

Instance Method Details

#runObject

This method is abstract.

Signature:

  • -> bool

Raises:

  • (NotImplementedError)


40
# File 'lib/packwerk/commands/base_command.rb', line 40

def run = raise NotImplementedError, "Abstract method called"