Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-16 16:33:11 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2016-06-20 22:48:28 +0300
commit483dc62eaac0e11717b5b103317c4441ec0ff23d (patch)
tree40b5954f0f5f0f181d3fa73ec36cd1492d2e0669 /lib/gitlab/template
parent96ae6099dd5921ae32139a206d598043520fb506 (diff)
Incorporate review
Diffstat (limited to 'lib/gitlab/template')
-rw-r--r--lib/gitlab/template/base_template.rb4
-rw-r--r--lib/gitlab/template/gitlab_ci_yml.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb
index 652a496b57b..4086d8701bf 100644
--- a/lib/gitlab/template/base_template.rb
+++ b/lib/gitlab/template/base_template.rb
@@ -1,6 +1,8 @@
module Gitlab
module Template
class BaseTemplate
+ attr_writer :content
+
def initialize(path)
@path = path
end
@@ -10,7 +12,7 @@ module Gitlab
end
def content
- File.read(@path)
+ @content ||= File.read(@path)
end
def categories
diff --git a/lib/gitlab/template/gitlab_ci_yml.rb b/lib/gitlab/template/gitlab_ci_yml.rb
index da7273b8d70..f1e96d22d64 100644
--- a/lib/gitlab/template/gitlab_ci_yml.rb
+++ b/lib/gitlab/template/gitlab_ci_yml.rb
@@ -1,6 +1,6 @@
module Gitlab
module Template
- class GitlabCIYml < BaseTemplate
+ class GitlabCiYml < BaseTemplate
class << self
def extension
'.gitlab-ci.yml'