Class: QuietQuality::Tools::BaseRunner

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/quiet_quality/tools/base_runner.rb

Constant Summary collapse

MAX_FILES =

In general, we don’t want to supply a huge number of arguments to a command-line tool.

100

Instance Method Summary collapse

Methods included from Logging

#debug, #info, #warn

Constructor Details

#initialize(changed_files: nil, file_filter: nil, command_override: nil, exec_override: nil) ⇒ BaseRunner

Returns a new instance of BaseRunner.



9
10
11
12
13
14
# File 'lib/quiet_quality/tools/base_runner.rb', line 9

def initialize(changed_files: nil, file_filter: nil, command_override: nil, exec_override: nil)
  @changed_files = changed_files
  @file_filter = file_filter
  @command_override = command_override
  @exec_override = exec_override
end

Instance Method Details

#commandObject



24
25
26
# File 'lib/quiet_quality/tools/base_runner.rb', line 24

def command
  fail(NoMethodError, "BaseRunner subclass must implement `command`")
end

#exec_commandObject



28
29
30
# File 'lib/quiet_quality/tools/base_runner.rb', line 28

def exec_command
  fail(NoMethodError, "BaseRunner subclass must implement `exec_command`")
end

#failure_status?(stat) ⇒ Boolean

distinct from error status - this is asking “does this status represent failures-found?”

Returns:

  • (Boolean)


37
38
39
# File 'lib/quiet_quality/tools/base_runner.rb', line 37

def failure_status?(stat)
  stat.exitstatus == 1
end

#invoke!Object



16
17
18
# File 'lib/quiet_quality/tools/base_runner.rb', line 16

def invoke!
  @_outcome ||= performed_outcome
end

#success_status?(stat) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/quiet_quality/tools/base_runner.rb', line 32

def success_status?(stat)
  stat.success?
end

#tool_nameObject



20
21
22
# File 'lib/quiet_quality/tools/base_runner.rb', line 20

def tool_name
  fail(NoMethodError, "BaseRunner subclass must implement `tool_name`")
end