diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-13 21:17:28 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-14 12:48:17 +0100 |
commit | 6b0a43aff36f0bbb9050b3c04155a3ccd9c1a75b (patch) | |
tree | fbe82328b917aacf19f2da12e77a6d4489f0a51a /app/controllers/projects/artifacts_controller.rb | |
parent | 154b8ceba4ac2d92a2387ad50d7f2b4ed5b2dd8a (diff) | |
download | gitlab-ce-6b0a43aff36f0bbb9050b3c04155a3ccd9c1a75b.tar.gz |
Improve readability of artifacts browser `Entry` related code
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index 00daac0cb30..dff0732bdfe 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -18,17 +18,17 @@ class Projects::ArtifactsController < Projects::ApplicationController return render_404 unless build.artifacts? directory = params[:path] ? "#{params[:path]}/" : '' - @path = build.artifacts_metadata_path(directory) + @entry = build.artifacts_metadata_entry(directory) - return render_404 unless @path.exists? + return render_404 unless @entry.exists? end def file - file_path = build.artifacts_metadata_path(params[:path]) + entry = build.artifacts_metadata_entry(params[:path]) - if file_path.exists? + if entry.exists? render json: { archive: build.artifacts_file.path, - path: Base64.encode64(file_path.path) } + entry: Base64.encode64(entry.path) } else render json: {}, status: 404 end |