BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
80a71576
Commit
80a71576
authored
Dec 18, 2015
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `Gitlab::StringPath` in CI build artifacts controller
parent
73d2c7a5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
artifacts_controller.rb
app/controllers/projects/artifacts_controller.rb
+8
-1
string_path.rb
lib/gitlab/string_path.rb
+12
-0
No files found.
app/controllers/projects/artifacts_controller.rb
View file @
80a71576
...
...
@@ -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?
...
...
lib/gitlab/string_path.rb
View file @
80a71576
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment