summaryrefslogtreecommitdiff
path: root/app/helpers/blob_helper.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-02 18:20:08 +0200
committerAlfredo Sumaran <alfredo@gitlab.com>2016-06-20 14:48:28 -0500
commit620d014aefd23030ed6ae043e223ccc5dc52fc8a (patch)
tree9324f2cbb23bdcc4f02d9b29b349894e4b43ac8c /app/helpers/blob_helper.rb
parent567f6a7b4271d97afd6dea1545210b9aba858421 (diff)
downloadgitlab-ce-620d014aefd23030ed6ae043e223ccc5dc52fc8a.tar.gz
Implement backend gitlab ci dropdown
This commit builds on the groundwork in ee008e300b1ec0abcc90e6a30816ec0754cea0dd, which refactored the backend so the same code could be used for new dropdowns. In this commit its used for templates for the `.gitlab-ci.yml` files.
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 2d42cce95ce..b30a01614be 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -186,10 +186,16 @@ module BlobHelper
end
def gitignore_names
- return @gitignore_names if defined?(@gitignore_names)
+ @gitignore_names ||=
+ Gitlab::Template::Gitignore.categories.keys.map do |k|
+ [k, Gitlab::Template::Gitignore.by_category(k).map { |t| { name: t.name } }]
+ end.to_h
+ end
- @gitignore_names = Gitlab::Template::Gitignore.categories.map do |k, _|
- [k, Gitlab::Template::Gitignore.by_category(k)]
- end.to_h
+ def gitlab_ci_ymls
+ @gitlab_ci_ymls ||=
+ Gitlab::Template::GitlabCIYml.categories.keys.map do |k|
+ [k, Gitlab::Template::GitlabCIYml.by_category(k).map { |t| { name: t.name } }]
+ end.to_h
end
end