Class: LabClient::Generator::Pages
- Inherits:
-
GroupTemplateHelper
- Object
- TemplateHelper
- GroupTemplateHelper
- LabClient::Generator::Pages
- Defined in:
- lib/labclient/generator/templates/pages.rb
Overview
Page Import Creation
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
Attributes inherited from GroupTemplateHelper
#group_name, #group_path, #group_suffix, #project_name
Attributes inherited from TemplateHelper
Instance Method Summary collapse
- #generate_pipelines ⇒ Object
- #generate_project(name) ⇒ Object
-
#list ⇒ Object
All Available Pages Projects.
- #setup ⇒ Object
- #setup_projects ⇒ Object
- #wait_for_import ⇒ Object
Methods inherited from GroupTemplateHelper
Methods included from Names
#create_file, #gen_description, #gen_groups, #gen_people, #gen_projects, #generate_names
Methods inherited from TemplateHelper
Constructor Details
This class inherits a constructor from LabClient::Generator::TemplateHelper
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
21 22 23 |
# File 'lib/labclient/generator/templates/pages.rb', line 21 def count @count end |
Instance Method Details
#generate_pipelines ⇒ Object
47 48 49 50 51 |
# File 'lib/labclient/generator/templates/pages.rb', line 47 def generate_pipelines @projects.each do |project| project.pipeline_create(ref: :master) end end |
#generate_project(name) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/labclient/generator/templates/pages.rb', line 39 def generate_project(name) @group.project_create( name: name, description: "#{name} Pages", import_url: "https://gitlab.com/pages/#{name}.git" ) end |
#list ⇒ Object
All Available Pages Projects
24 25 26 27 28 29 30 31 32 |
# File 'lib/labclient/generator/templates/pages.rb', line 24 def list %w[ brunch doxygen emacs-reveal frozen-flask gatsby gitbook hakyll harp hexo hugo hyde ikiwiki jekyll jigsaw lektor metalsmith middleman mkdocs nanoc nikola nuxt octopress org-mode pelican plain-html sphinx vuepress zim ] end |
#setup ⇒ Object
34 35 36 37 |
# File 'lib/labclient/generator/templates/pages.rb', line 34 def setup super self.count = opts[:count] || 5 end |
#setup_projects ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/labclient/generator/templates/pages.rb', line 57 def setup_projects @projects = list.sample(count).map do |name| generate_project(name) end wait_for_import generate_pipelines end |
#wait_for_import ⇒ Object
53 54 55 |
# File 'lib/labclient/generator/templates/pages.rb', line 53 def wait_for_import @projects.each(&:wait_for_import) end |