Class: Gitlab::Template::MetricsDashboardTemplate

Inherits:
BaseTemplate
  • Object
show all
Defined in:
lib/gitlab/template/metrics_dashboard_template.rb

Instance Attribute Summary

Attributes inherited from BaseTemplate

#category

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseTemplate

#<=>, all, by_category, category_directory, dropdown_names, find, #full_name, #initialize, #name, #resolve!, template_subsets, #to_json

Constructor Details

This class inherits a constructor from Gitlab::Template::BaseTemplate

Class Method Details

.base_dirObject


22
23
24
# File 'lib/gitlab/template/metrics_dashboard_template.rb', line 22

def base_dir
  Rails.root.join('lib/gitlab/metrics/templates')
end

.categoriesObject


16
17
18
19
20
# File 'lib/gitlab/template/metrics_dashboard_template.rb', line 16

def categories
  {
    "General" => ''
  }
end

.extensionObject


12
13
14
# File 'lib/gitlab/template/metrics_dashboard_template.rb', line 12

def extension
  '.metrics-dashboard.yml'
end

.finder(project = nil) ⇒ Object


26
27
28
# File 'lib/gitlab/template/metrics_dashboard_template.rb', line 26

def finder(project = nil)
  Gitlab::Template::Finders::GlobalTemplateFinder.new(self.base_dir, self.extension, self.categories)
end

Instance Method Details

#contentObject


6
7
8
9
# File 'lib/gitlab/template/metrics_dashboard_template.rb', line 6

def content
  explanation = "# This file is a template, and might need editing before it works on your project."
  [explanation, super].join("\n")
end