Class: Sitepress::ProjectTemplate

Inherits:
Object
  • Object
show all
Includes:
FileUtils
Defined in:
lib/sitepress/project_template.rb

Overview

Creates new projects from a template.

Constant Summary collapse

DEFAULT_TEMPLATE =
File.expand_path("../../../templates/default",__FILE__).freeze

Instance Method Summary collapse

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

#bundleObject



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