lib/salus/processor.rb
def interpolate_local_report_uris(report_directives)
      report_directives.map do |report_uri|
        uri_object = URI(report_uri['uri'])
        scheme = URI(report_uri['uri']).scheme
        file_path = "#{uri_object.host}#{uri_object.path}"

        if Salus::Config::LOCAL_FILE_SCHEME_REGEX.match?(scheme)
          report_uri['uri'] = "file://#{File.join(@repo_path, file_path)}"
        end

        report_uri
      end
    end
# If the URI is local, we will need to prepend the repo_path since
# the report URI is relative to the root of the repo. This allows us
# to print reports to a location outside of Salus's docker container.
If the URI is local, we will need to prepend the repo_path since
the report URI is relative to the root of the repo. This allows us
to print reports to a location outside of Salus's docker container.
If the URI is local we will need to prepend the repo_path since the report URI is relative to the root of the repo . This allows us to print reports to a location outside of Salus ' s docker container .
def interpolate_local_report_uris(report_directives)
      report_directives.map do |report_uri|
        uri_object = URI(report_uri['uri'])
        scheme = URI(report_uri['uri']).scheme
        file_path = "#{uri_object.host}#{uri_object.path}"
        if Salus::Config::LOCAL_FILE_SCHEME_REGEX.match?(scheme)
          report_uri['uri'] = "file://#{File.join(@repo_path, file_path)}"
        end
        report_uri
      end
    end
def interpolate_local_report_uris ( report_directives ) report_directives . map do | report_uri | uri_object = URI ( report_uri [ 'uri' ] ) scheme = URI ( report_uri [ 'uri' ] ) . scheme file_path = "#{uri_object.host}#{uri_object.path}" if Salus :: Config :: LOCAL_FILE_SCHEME_REGEX . match? ( scheme ) report_uri [ 'uri' ] = "file://#{File.join(@repo_path, file_path)}" end report_uri end end
If the URI is local, we will need to prepend the repo_path since
the report URI is relative to the root of the repo.
If the URI is local we will need to prepend the repo_path since the report URI is relative to the root of the repo .
report_directives