diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-17 08:37:19 +0200 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-20 14:48:28 -0500 |
commit | bbfd62bc34061089f753e4170912be64bae16f84 (patch) | |
tree | 3ed2d54d4afc4449933d97ce3c992a2682a0d3e7 /lib/gitlab/template/base_template.rb | |
parent | a18df1d15af68be4d129412ad2a6145277ca43d3 (diff) | |
download | gitlab-ce-bbfd62bc34061089f753e4170912be64bae16f84.tar.gz |
fixup! override content method
Diffstat (limited to 'lib/gitlab/template/base_template.rb')
-rw-r--r-- | lib/gitlab/template/base_template.rb | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb index 4086d8701bf..760ff3e614a 100644 --- a/lib/gitlab/template/base_template.rb +++ b/lib/gitlab/template/base_template.rb @@ -1,8 +1,6 @@ module Gitlab module Template class BaseTemplate - attr_writer :content - def initialize(path) @path = path end @@ -12,19 +10,7 @@ module Gitlab end def content - @content ||= File.read(@path) - end - - def categories - raise NotImplementedError - end - - def extension - raise NotImplementedError - end - - def base_dir - raise NotImplementedError + File.read(@path) end class << self @@ -39,6 +25,18 @@ module Gitlab directory ? new(File.join(category_directory(directory), file_name)) : nil end + def categories + raise NotImplementedError + end + + def extension + raise NotImplementedError + end + + def base_dir + raise NotImplementedError + end + def by_category(category) templates_for_directory(category_directory(category)) end |