Class: CleoQualityReview::RunArtifacts::RawCheckOutputs
- Inherits:
-
Object
- Object
- CleoQualityReview::RunArtifacts::RawCheckOutputs
- Defined in:
- lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb
Overview
Handles persisted raw output files for quality checks.
Defined Under Namespace
Classes: Record
Instance Method Summary collapse
-
#initialize(path:) ⇒ RawCheckOutputs
constructor
A new instance of RawCheckOutputs.
- #records ⇒ Object
- #to_h ⇒ Object
- #write(check_output) ⇒ Object
Constructor Details
#initialize(path:) ⇒ RawCheckOutputs
Returns a new instance of RawCheckOutputs.
44 45 46 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 44 def initialize(path:) @path = path end |
Instance Method Details
#records ⇒ Object
61 62 63 64 65 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 61 def records records_by_check_name = legacy_records.to_h(&:to_record_pair) records_by_check_name.merge!(typed_records.to_h(&:to_record_pair)) records_by_check_name.values end |
#to_h ⇒ Object
57 58 59 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 57 def to_h records.to_h(&:to_pair) end |
#write(check_output) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 48 def write(check_output) check_name, tool_type, extension, output = check_output.to_h.values_at( :check_name, :tool_type, :extension, :raw_output ) check_path = check_output_path(check_name: check_name, tool_type: tool_type) FileUtils.mkdir_p(check_path) File.write(File.join(check_path, "raw_output.#{extension}"), output) end |