summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-09 14:41:43 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-01-14 12:48:15 +0100
commit61fb47a43202332fe9ac57847996da929ba42d3f (patch)
tree95b0838eebafd9ea6c382efbfd78eaa0f3b4d6f7 /app/models
parent387b27813d1d496c015f4f174812b4761c32648d (diff)
downloadgitlab-ce-61fb47a43202332fe9ac57847996da929ba42d3f.tar.gz
Simplify implementation of build artifacts browser (refactoring)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 7983ce0e88e..2d2206cc4d7 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -338,21 +338,19 @@ module Ci
end
def artifacts_browse_url
- if artifacts?
+ if artifacts_browser_supported?
browse_namespace_project_build_artifacts_path(project.namespace, project, self)
end
end
def artifacts_browser_supported?
- # TODO, since carrierwave 0.10.0 we will be able to check mime type here
- #
artifacts? && artifacts_file.path.end_with?('zip') && artifacts_metadata.exists?
end
- def artifacts_metadata_string_path(path)
- file = artifacts_metadata.path
- Gitlab::Ci::Build::Artifacts::Metadata.new(file, path).to_string_path
+ def artifacts_metadata_path(path)
+ metadata_file = artifacts_metadata.path
+ Gitlab::Ci::Build::Artifacts::Metadata.new(metadata_file, path).to_path
end
private