debian-mirror-gitlab/app/presenters/ci/pipeline_artifacts/code_coverage_presenter.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
545 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
module Ci
module PipelineArtifacts
2021-03-11 19:13:27 +05:30
class CodeCoveragePresenter < Gitlab::View::Presenter::Delegated
2020-11-24 15:15:51 +05:30
include Gitlab::Utils::StrongMemoize
def for_files(filenames)
coverage_files = raw_report["files"].select { |key| filenames.include?(key) }
{ files: coverage_files }
end
private
def raw_report
strong_memoize(:raw_report) do
self.each_blob do |blob|
Gitlab::Json.parse(blob)
end
end
end
end
end
end