Class: Sitepress::ProjectTemplate
- Inherits:
-
Object
- Object
- Sitepress::ProjectTemplate
- Includes:
- FileUtils
- Defined in:
- lib/sitepress/project_template.rb
Overview
Creates new projects from a template.
Constant Summary collapse
- DEFAULT_TEMPLATE =
File.("../../../templates/default",__FILE__).freeze
Instance Method Summary collapse
- #bundle ⇒ Object
- #copy(to:) ⇒ Object
-
#initialize(path: DEFAULT_TEMPLATE) ⇒ ProjectTemplate
constructor
A new instance of ProjectTemplate.
Constructor Details
#initialize(path: DEFAULT_TEMPLATE) ⇒ ProjectTemplate
Returns a new instance of ProjectTemplate.
10 11 12 |
# File 'lib/sitepress/project_template.rb', line 10 def initialize(path: DEFAULT_TEMPLATE) @path = path end |
Instance Method Details
#bundle ⇒ Object
18 19 20 21 |
# File 'lib/sitepress/project_template.rb', line 18 def bundle Dir.chdir @path do end end |
#copy(to:) ⇒ Object
14 15 16 |
# File 'lib/sitepress/project_template.rb', line 14 def copy(to:) cp_r @path, to end |