Class: Gitlab::Template::GitignoreTemplate

Inherits:
BaseTemplate show all
Defined in:
lib/gitlab/template/gitignore_template.rb

Instance Attribute Summary

Attributes inherited from BaseTemplate

#category

Class Method Summary collapse

Methods inherited from BaseTemplate

#<=>, all, by_category, category_directory, #content, 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


18
19
20
# File 'lib/gitlab/template/gitignore_template.rb', line 18

def base_dir
  Rails.root.join('vendor/gitignore')
end

.categoriesObject


11
12
13
14
15
16
# File 'lib/gitlab/template/gitignore_template.rb', line 11

def categories
  {
    "Languages" => '',
    "Global"    => 'Global'
  }
end

.extensionObject


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

def extension
  '.gitignore'
end

.finder(project = nil) ⇒ Object


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

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