Commit 80a71576 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use `Gitlab::StringPath` in CI build artifacts controller

parent 73d2c7a5
......@@ -15,7 +15,10 @@ class Projects::ArtifactsController < Projects::ApplicationController
end
def browse
@metadata = build.artifacts_metadata
path = params[:path].to_s
@paths = artifacts_metadata.map do |_artifact_file|
Gitlab::StringPath.new(path, artifacts_metadata)
end
end
private
......@@ -28,6 +31,10 @@ class Projects::ArtifactsController < Projects::ApplicationController
@artifacts_file ||= build.artifacts_file
end
def artifacts_metadata
@artifacts_metadata ||= build.artifacts_metadata
end
def authorize_download_build_artifacts!
unless can?(current_user, :download_build_artifacts, @project)
if current_user.nil?
......
......@@ -34,6 +34,18 @@ module Gitlab
!directory?
end
def has_parent?
raise NotImplementedError
end
def parent
raise NotImplementedError
end
def directories
raise NotImplementedError
end
def files
raise NotImplementedError
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment