Module: Routing::ArtifactsHelper
- Included in:
- GitlabRoutingHelper
- Defined in:
- app/helpers/routing/artifacts_helper.rb
Instance Method Summary collapse
- #artifacts_action_path(path, project, build) ⇒ Object
- #expose_fast_artifacts_path(project, job, action, params = {}) ⇒ Object
-
#fast_browse_project_job_artifacts_path(project, job) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/browse(/*path).
-
#fast_download_project_job_artifacts_path(project, job, params = {}) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/download(.:format).
-
#fast_keep_project_job_artifacts_path(project, job) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/keep(.:format).
Instance Method Details
#artifacts_action_path(path, project, build) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/helpers/routing/artifacts_helper.rb', line 33 def artifacts_action_path(path, project, build) action, path_params = path.split('/', 2) args = [project, build, path_params] case action when 'download' download_project_job_artifacts_path(*args) when 'browse' browse_project_job_artifacts_path(*args) when 'file' file_project_job_artifacts_path(*args) when 'raw' raw_project_job_artifacts_path(*args) end end |
#expose_fast_artifacts_path(project, job, action, params = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'app/helpers/routing/artifacts_helper.rb', line 23 def expose_fast_artifacts_path(project, job, action, params = {}) path = "#{project.full_path}/-/jobs/#{job.id}/artifacts/#{action}" unless params.empty? path += "?#{params.to_query}" end Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, path) end |
#fast_browse_project_job_artifacts_path(project, job) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/browse(/*path)
19 20 21 |
# File 'app/helpers/routing/artifacts_helper.rb', line 19 def fast_browse_project_job_artifacts_path(project, job) expose_fast_artifacts_path(project, job, :browse) end |
#fast_download_project_job_artifacts_path(project, job, params = {}) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/download(.:format)
9 10 11 |
# File 'app/helpers/routing/artifacts_helper.rb', line 9 def fast_download_project_job_artifacts_path(project, job, params = {}) expose_fast_artifacts_path(project, job, :download, params) end |
#fast_keep_project_job_artifacts_path(project, job) ⇒ Object
/*namespace_id/:project_id/-/jobs/:job_id/artifacts/keep(.:format)
14 15 16 |
# File 'app/helpers/routing/artifacts_helper.rb', line 14 def fast_keep_project_job_artifacts_path(project, job) expose_fast_artifacts_path(project, job, :keep) end |