Class: QuietQuality::Executors::BaseExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/quiet_quality/executors/base_executor.rb

Direct Known Subclasses

ConcurrentExecutor, SerialExecutor

Instance Method Summary collapse

Constructor Details

#initialize(tools:, changed_files: nil) ⇒ BaseExecutor

Returns a new instance of BaseExecutor.



4
5
6
7
# File 'lib/quiet_quality/executors/base_executor.rb', line 4

def initialize(tools:, changed_files: nil)
  @tools = tools
  @changed_files = changed_files
end

Instance Method Details

#any_failure?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/quiet_quality/executors/base_executor.rb', line 21

def any_failure?
  pipelines.any?(&:failure?)
end

#execute!Object



9
10
11
# File 'lib/quiet_quality/executors/base_executor.rb', line 9

def execute!
  pipelines.none?(&:failure?)
end

#failed_outcomesObject



29
30
31
# File 'lib/quiet_quality/executors/base_executor.rb', line 29

def failed_outcomes
  @_failed_outcomes ||= outcomes.select(&:failure?)
end

#messagesObject



17
18
19
# File 'lib/quiet_quality/executors/base_executor.rb', line 17

def messages
  @_messages ||= Messages.new(pipelines.map(&:messages).map(&:all).reduce(&:+))
end

#outcomesObject



13
14
15
# File 'lib/quiet_quality/executors/base_executor.rb', line 13

def outcomes
  @_outcomes ||= pipelines.map(&:outcome)
end

#successful_outcomesObject



25
26
27
# File 'lib/quiet_quality/executors/base_executor.rb', line 25

def successful_outcomes
  @_successful_outcomes ||= outcomes.select(&:success?)
end